Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Warren 30 posts 95 karma points
    Feb 05, 2015 @ 05:43
    Warren
    0

    MvcRenderContourForm.cshtml NullReferenceException Error

    Backgroud:
    I have a local code base that I use to develop on and debug my code, which utilises the Visual Studio Development IIS server for testing.
    I also have a separate testing IIS server, that I utilise that unables user testing etc.
    Both instances of Umbraco point to the same database. This set up works well for me.

    Late last year I wanted to get Contour forms on to the site. (I have a licence for contour forms).
    So to emulate the update process that I would have to do on the production server, I did the install on the Test IIS server, not my local copy where I develop on.

    To get this done, I updated my Umbraco instance on the test server from 6.0.5 to 6.2.2, to allow me to install Contour forms ver 3.0.21.
    This worked perfectly, and I now have both my test server and my production server upgraded to Umbraco 6.2.2 and they both have Contour version 3.0.21.

    My Problem
    I have now copied back the umbraco folder set from my test server to replace my local copy of Umbraco, so I can continue writing code for the site. (Yes I did make a copy before I did this)
    I have no problems starting my local umbraco instance, (which uses Visual Studio Development IIS Server)
    I can access the umbraco backend with no problems, and I can also access the logon page with no problems.
    The Problem is after logging on, when I go to serve up my homepage.
    I get the following error inside the MvcRenderContourForm.cshtml code: "NullReferenceException was unhadled by user code". The error appears on the line @Html.RenderMvcAction.
    Here is a screen shot of the error.



    I have tried the following:
    - Republished the entire site.
    - Remove the contour licence file from the bin directory.
    - Removed all countour forms from the backend.

    There are no contour forms refernced on the home page.

    I cannot see what object has the Nulll reference (they all look like they have been initialised). 

    So I am stuck, development on my website has stopped becuase I cant get past this error.

    Any suggestions on how to fix it will greatly appreciated. 

    Thanks Warren

  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    Feb 09, 2015 @ 17:18
    Tim
    0

    Did you copy the /bin/ folder from the upgraded sites to your local version as well as the /umbraco/ folder? If you upgraded Umbraco on the test version, you'll probably want the /config/ and /umbraco_client/ folders too.

  • Warren 30 posts 95 karma points
    Feb 10, 2015 @ 20:37
    Warren
    0

    Hi Tim

    Thanks for your response. Yes, I copied the entire directory structure. So all directories were copied accross to the test system.

    Is it unusual that the back in and the login page do not have the error?

    To get around the issue, I unticked the "Break when this exception type is user-unhandled" box. Now I wonder if I am getting this unhandled error on my production site. Can you point me to a log that I can check to see if I am getting an error relating to this issue?

    Thanks
    Warren 

     

     

  • Warren 30 posts 95 karma points
    Feb 16, 2015 @ 21:37
    Warren
    0

    Hi Tim

    I notice that I am geeting these errors:

     

    Related to above I suspect. How should I resolve this?

    Thanks

  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    Feb 17, 2015 @ 10:10
    Tim
    0

    Hmmmm. Is the Umbraco Forms macro referenced on the homepage (even if no form is assigned)? Go through your site and see if you can find any references to that anywhere.

  • Warren 30 posts 95 karma points
    Mar 08, 2015 @ 22:53
    Warren
    0

    Hi Tim

    I have just manged to get back to this issue. Here is what I have found.

    It appears the call to MvcRenderContourForm.cshtm is coming from a umbraco.MacroEngines.Library function!  (See screen shot below) 
    After removing both Library.Truncate and Library.StripHtml separately, it appears that is both calls on their own are making the call to 
    MvcRenderContourForm.cshtm and giving the Null Reference exception error.

    Why is the umbraco.MacroEngines.Library functions calling MvcRenderContourForm.cshtm ?

    It would be great to understand why I am getting a null exception error within MvcRenderContourForm.cshtm, especially when there are no contour forms on this page.

     

  • Warren 30 posts 95 karma points
    Apr 22, 2015 @ 07:14
    Warren
    0

    Hi Tim

    Have you had a chance to look at this again?

    I have rechecked, and the Library calls within my macro script are still making calls to MvcRenderContourForm.cshtm.

    As you can see from this trace, the macro named HPNewsList (which calls HomePageNewsList.cshtml) starts to reference Umbraco Contour.

     

    Here is the macro script again, which does not reference Contour at all.

     

     Where is what is showing up in the degug window

    As you can see, I am still getting a System.NullReferenceException error during the execution of the code. (In fact I get two, both relating to MVCRenderContourForm.cshtml, even though it has more than two iterations in the macro script)

    Lastly, if I remove the MvcRenderContourForm.cshtml file from the macroScripts folder, my macroscript HomePageNewsList.cshtml fails to execute and load.

    I would really like to know how to stop Library calls from executing the 
    MvcRenderContourForm.cshtml script.

    Any thoughts?

    Thanks

    Warren

     

     

     

     

     

     

  • Warren 30 posts 95 karma points
    Apr 29, 2015 @ 03:17
    Warren
    0

    The issue seems to have dissappeared.

    It may of been due to the fact that I had not updated the web.config to reflect the new membership provider details, when I moved from 6.1 to 6.2

Please Sign in or register to post replies

Write your reply to:

Draft