加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 持久对象引用未设置错误[没有相关的源代码行]

发布时间:2020-12-15 22:13:58 所属栏目:百科 来源:网络整理
导读:我一直很高兴开发一个MVC / Sitecore应用程序,一切都很好. 然而,突然间我得到一个错误告诉我,我的Object引用没有设置为Object的实例.错误页面指向一条没有其他结束括号的行. 我尝试删除视图中可能导致错误的代码行,但错误仍然在同一个右括号中. 所以我评论了
我一直很高兴开发一个MVC / Sitecore应用程序,一切都很好.

然而,突然间我得到一个错误告诉我,我的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:WindowsMicrosoft.NETFramework64v4.0.30319Temporary
ASP.NET Filesroot1a47b3ff21a05ef3App_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:WindowsMicrosoft.NETFramework64v4.0.30319Temporary ASP.NET
Filesroot1a47b3ff21a05ef3App_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
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList
1
filters,ActionResult actionResult) +890
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList1
filters,ActionResult actionResult) +890
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext
controllerContext,IList
1 filters,ActionResult actionResult) +97
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext
controllerContext,String actionName) +879

我完全停止了WWW服务,关闭了Visual Studio,从Temporary ASP.NET文件夹中删除了所有临时文件,重新启动了服务,重新加载了Visual Studio,但仍然存在错误.

有人可以提出任何建议吗?

解决方法

如果其他人偶然发现,我在IIS中删除了网站,然后重新创建它,错误消失了.同一位置的相同文件,只是IIS.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读