I have been happily developing an MVC/Sitecore App and all was fine.
However all of a sudden I got an error telling me that I had a Object reference not set to the instance of an Object
going on. The error page pointed to a line that had nothing other that a closing brace.
I tried removing the lines of code in the view that could be causing the error but the error remained on the same closing brace.
So I commented out the whole block including the closing brace. Now I am getting the following error:
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
[No relevant source lines]
Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1a47b3ff\21a05ef3\App_Web_kieomnc4.1.cs Line: 0
[NullReferenceException: Object reference not set to an instance of an object.]
ASP._Page_Views_MyCompany_Common_AddressEdit_cshtml.Execute() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1a47b3ff\21a05ef3\App_Web_pjrqnchq.1.cs:0
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +279
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +124
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +109
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +379 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +108
1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
1 filters, ActionResult actionResult) +97
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +879
I have stopped the WWW service completely, closed Visual Studio, deleted all the temp files from the Temporary ASP.NET folder, restarted the service, reloaded Visual Studio but still the error remains.
Can anyone make any suggestions?
In case anyone else stumbles on this, I deleted the website in IIS then recreated it and the error disappeared. Same files in the same location, just IIS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With