简体   繁体   English

Global.asax Application_Error NullReference 异常

[英]Global.asax Application_Error NullReference Exception

Asp.net web Forms Asp.net 网络表单
in my Global.asax i'm handling Application error在我的 Global.asax 中,我正在处理应用程序错误
i get Null Reference Exception Sender Global.asax我得到空引用异常发件人 Global.asax
i debugged all functions inside non of them return error i'm sure it is from else where the problem that我调试了其中的所有函数,没有一个返回错误,我确定问题出在其他地方

Server.GetLastError()

Does not give information about the Error or the code giving the error不提供有关错误的信息或给出错误的代码在此处输入图片说明

This can happen if you use incompatible code in Application_PostAuthenticateRequest or elsewhere in Global.ascx.cs.如果您在Application_PostAuthenticateRequest或 Global.ascx.cs 中的其他地方使用不兼容的代码,就会发生这种情况。

See this answer for example: https://stackoverflow.com/a/21097374/1657610例如,请参阅此答案: https : //stackoverflow.com/a/21097374/1657610

If you have any code in Application_PostAuthenticateRequest or elsewhere in Global.ascx.cs, try commenting it out to see if the issue goes away.如果您在Application_PostAuthenticateRequest或 Global.ascx.cs 的其他地方有任何代码,请尝试将其注释掉以查看问题是否消失。 If it goes away, selectively reenable the code until the issue returns.如果它消失,请有选择地重新启用代码,直到问题再次出现。 In this way you can isolate the issue to one or two lines of code.通过这种方式,您可以将问题隔离到一两行代码中。 At this point, either the reason may become obvious, or an internet search specific to that code is likely to provide the explanation.此时,原因可能变得明显,或者特定于该代码的互联网搜索可能会提供解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Global.asax中的Application_Error自定义错误处理程序 - Application_Error custom error handler in Global.asax Starts..c中的Global.asax Application_Error等价物 - Global.asax Application_Error equivalent in Startup.cs global.asax 中的 Application_Error 未捕获 WebAPI 中的错误 - Application_Error in global.asax not catching errors in WebAPI Global.asax Application_Error无法在IIS上触发 - Global.asax Application_Error not firing on IIS 我应该抛出Global.asax中的Application_Error处理程序中发生的异常吗? - Should I throw out an exception that happen in Application_Error handler in Global.asax? global.asax Application_Error 在原始页面上报告 - global.asax Application_Error reporting on original page 在Global.asax文件中创建Application_Error处理程序,获取解析器错误 - Creating Application_Error handler in Global.asax file getting a Parser Error 获取引发Global.asax Application_Error中的最后一个错误的网页 - Get web page that threw the last error in Global.asax Application_Error Application_Error中的ASP.net Global.asax错误详细信息 - ASP.net Global.asax error detail in Application_Error ASP.NET MVC自定义错误处理Application_Error Global.asax? - ASP.NET MVC Custom Error Handling Application_Error Global.asax?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM