[英]Sudden IIS application's shutdown
I have a multiple versions of an ASP.net website, all of them are working fine except the latest version which recently started to stop suddenly. 我有一个ASP.net网站的多个版本,除了最近开始突然停止运行的最新版本以外,其他所有版本都工作正常。 Each version runs in a different application pool.
每个版本都在不同的应用程序池中运行。 Our investigations resulted in the following:
我们的调查结果如下:
I'm using windows server 2012 64x, with IIS 8.5 and .net V4.5. 我正在使用Windows Server 2012 64x,IIS 8.5和.net V4.5。 Any hints are appreciated
任何提示表示赞赏
Update-1: Here is a snapshot for the page with errors. 更新1:这是错误页面的快照 。
Update-2: After making few tests and adding more logs here and there, I can summarize the issue in a simpler way: First the issue shows only and only in the case I enable the "precompile during publishing" option while publishing my website, and merging all output DLLs in single assembly. 更新2:经过几次测试并在各处添加了更多日志之后,我可以用一种更简单的方式来概括该问题:首先,该问题仅在并且仅在发布网站时启用“发布期间预编译”选项的情况下显示,并在单个程序集中合并所有输出DLL。 After publishing with the above configuration, the Application_Start event will triggered on first page request, which is normal, and the main code I have in this event is to register all CSS & JS bundles, and configure URL routing.
使用上述配置发布后,Application_Start事件将在第一页请求上触发,这是正常现象,而我在此事件中拥有的主要代码是注册所有CSS和JS包,并配置URL路由。 The application will work fine for approx.
该应用程序将正常运行约。 30 minutes, then the Application_End will be triggered (with "HostingEnvironment initiated shutdown" shutdown reason) but the Application_Start won't be triggered again!.
30分钟后,将触发Application_End(“由于HostingEnvironment启动了关闭”关闭原因),但不会再次触发Application_Start! The Strange thing that the application will continue to serve subsequent requests (Ex: connect to database, do logging, authenticate users, serving WCF services requests...) but all bundles and URL routings that are registered in the Application_Start are lost.
奇怪的是,应用程序将继续为后续请求提供服务(例如:连接到数据库,执行日志记录,验证用户身份,为WCF服务请求提供服务...),但所有在Application_Start中注册的捆绑包和URL路由都将丢失。 Another hint that general errors (Ex: 404) which are processed in the global.asax file are not getting processed after the Application_End is triggered!
另一个提示是,触发Application_End之后,不会处理global.asax文件中处理的一般错误(例如:404)! It seems like the application just ignore or forget to process this file again!
看来应用程序只是忽略或忘记再次处理此文件!
The issue is finally solved after fixing all compilation warnings. 修复所有编译警告后,终于解决了该问题。 I can't tell which one has fixed the issue, but thought to share my experience anyways.
我无法确定是哪个人解决了该问题,但无论如何想分享我的经验。 The warnings found was as for the below:
发现的警告如下:
Regards, 问候,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.