【发布时间】:2020-06-05 19:49:21
【问题描述】:
我有一个带有长轮询 IHttpAsyncHandler 的旧版 Web 表单应用程序,它开始在事件日志中引发异常,但信息很少。如果长轮询 XMLHttpRequest 未决并且我对 web.config 进行了更改,我可以在 IIS express 中重现该错误。这会回收进程并在调试器和事件日志中引发相同的 NullReferenceException:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 05/06/2020 2:30:09 PM
Event time (UTC): 05/06/2020 6:30:09 PM
Event ID: c8428fb2935c47be90ebc6a7849063e6
Event sequence: 7
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2/ROOT/WebApp-2-132358551451863719
Trust level: Full
Application Virtual Path: /WebApp
Application Path: C:\Users\naask\source\repos\WebApp\
Machine name: DESKTOP-S7T1J31
Process information:
Process ID: 11892
Process name: iisexpress.exe
Account name: DESKTOP-S7T1J31\naask
Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: http://localhost:48061/WebApp/edits?id=~/somepath.aspx/26264&wait=true
Request path: /WebApp/edits
User host address: ::1
User:
Is authenticated: False
Authentication Type:
Thread account name: DESKTOP-S7T1J31\naask
Thread information:
Thread ID: 6
Thread account name: DESKTOP-S7T1J31\naask
Is impersonating: False
Stack trace: at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Custom event details:
在调试器中,尝试加载符号信息,但失败:
异常信息与事件日志数据匹配:
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
大概我正在寻找的符号在 System.Web 中,但我已经加载了这些符号并且我已经 setup VS to debug framework code:
我不确定从这里去哪里调试 IHttpAsyncHandler 的问题。长轮询处理程序使用信号量上的ThreadPool.RegisterWaitForSingleObject 来等待事件,并在该事件发生时同时释放所有等待者。我只在 AppPool 回收后看到这些错误。
【问题讨论】: