daz*_*ury 13 c# asp.net iis asp.net-mvc appharbor
我开始看到在Appharbor上托管的.Net MVC网络应用程序中出现错误,同时后台线程正在运行 - 经过仔细分析 - 我无法解决问题.
首先,我注意到的例外情况是ThreadAbortException.
但是,这实际上只是表示该线程正在被杀死.在线程被杀死之前,您可以看到IIS创建了一个新工作器,并Application_Start在同一台机器上调用.一旦新应用程序启动并运行,IIS将终止旧应用程序,并按预期处理新请求.
同时,IIS会记录以下消息:
ShutDown Message: IIS configuration change
HostingEnvironment initiated shutdown
HostingEnvironment caused shutdown
ShutDown Stack: at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at System.Web.Hosting.HostingEnvironment.InitiateShutdownInternal()
at System.Web.Hosting.HostingEnvironment.InitiateShutdownWithoutDemand()
at System.Web.Hosting.PipelineRuntime.StopProcessing()
Run Code Online (Sandbox Code Playgroud)
在.Net Health Monitor Logging中,您将获得:
Message: Application is shutting down. Reason: Configuration changed.
Event Detail Code: 50004
Run Code Online (Sandbox Code Playgroud)
一个快速的谷歌揭示了我怀疑是错误原因的源代码:
if (!HostingEnvironment.StopListeningWasCalled && !HostingEnvironment.ShutdownInitiated) {
// If GL_STOP_LISTENING wasn't triggered, the reset is likely due to a configuration change.
HttpRuntime.SetShutdownReason(ApplicationShutdownReason.ConfigurationChange, "IIS configuration change");
}
Run Code Online (Sandbox Code Playgroud)
来源:https://github.com/Microsoft/referencesource/blob/master/System.Web/Hosting/IPipelineRuntime.cs
我的第一个想法是在bin文件夹和主应用程序目录中检查文件更改的时间戳 - 但是,在没有任何文件更改的情况下抛出此错误.鉴于它只发生在Appharbor上,我无法附加到进程并以这种方式进行调试.我还监视了内存使用情况,并没有看到任何问题.
源代码说明:
如果未触发GL_STOP_LISTENING,则重置可能是由于配置更改造成的.
因此,如果web.config /其他配置文件没有改变,还有什么可能导致错误和应用程序回收?
看来这是微软的一个错误。
在运行 Windows Server 2012 R2 的服务器上发生许多 App_Data 文件更改后,ASP.Net 应用程序意外关闭
修补程序: https: //support.microsoft.com/en-us/kb/3052480
最后评论: 09/08/2015 16:29:00
应用此修补程序后,错误就消失了!
| 归档时间: |
|
| 查看次数: |
4594 次 |
| 最近记录: |