然而,突然间我得到一个错误告诉我,我的Object引用没有设置为Object的实例.错误页面指向一条没有其他结束括号的行.
我尝试删除视图中可能导致错误的代码行,但错误仍然在同一个右括号中.
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
1
filters,Int32 filterIndex,ResultExecutingContext preContext,
ControllerContext controllerContext,ActionResult actionResult) +108
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
filters,ActionResult actionResult) +890
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1
1 filters,ActionResult actionResult) +97
filters,ActionResult actionResult) +890
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext
controllerContext,IList
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext
controllerContext,String actionName) +879
我完全停止了WWW服务,关闭了Visual Studio,从Temporary ASP.NET文件夹中删除了所有临时文件,重新启动了服务,重新加载了Visual Studio,但仍然存在错误.
有人可以提出任何建议吗?
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。