简体   繁体   English

突然的IIS应用程序关闭

[英]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: 我们的调查结果如下:

  • Application_End event is getting fired after couple minutes from starting the web application. 启动Web应用程序几分钟后,将触发Application_End事件。 However, the Application_Start is not being triggered after that. 但是,此后未触发Application_Start。
  • After the application is stopped, most pages works with no styles, as our styles are bundled using "BundleTable". 停止应用程序后,大多数页面无法使用任何样式,因为我们的样式是使用“ BundleTable”捆绑在一起的。 All bundles return 404 error, but the login process which relies on a web service works fine, and moves me to the home page (with no styles due to 404 response) 所有捆绑软件均返回404错误,但是依赖于Web服务的登录过程运行良好,并将我移至主页(由于404响应,没有样式)
  • Requesting any physical resource (image/js/css/svc) works fine 请求任何物理资源(image / js / css / svc)都可以
  • After the Application_End event get fired, the w3wp process related to this application's pool remains running. 触发Application_End事件后,与此应用程序池相关的w3wp进程仍在运行。 Killing it with task manager makes no change. 使用任务管理器杀死它不会改变。 it will start again without causing the application_start to get fired 它将再次启动而不会导致application_start被解雇
  • Stop/restart/recycle IIS/pool doesn't cause the Application_Start to get fired (I'm checking using custom logging). 停止/重新启动/回收IIS /池不会导致Application_Start被触发(我正在使用自定义日志记录进行检查)。 Deleting asp temp files sometimes works but not everytime. 有时会删除asp临时文件,但并非每次都删除。 Now I've tried everything but couldn't make it start again! 现在,我已经尝试了所有方法,但无法重新开始!
  • List item 项目清单

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: 发现的警告如下:

  1. Removing unused variables (about 10) (shouldn't affect) 删除未使用的变量(大约10个)(不会影响)
  2. Duplicated namespace importing (about 10) (shouldn't affect) 重复的名称空间导入(大约10个)(不应影响)
  3. We had an outdated WCF service proxy. 我们有一个过时的WCF服务代理。 So we generated the new one (couple new methods were not added, and some changes on data types. However, this service is usually being called by some external extension that was out of our testing scope 因此,我们生成了新方法(未添加新方法,并且对数据类型进行了一些更改。但是,此服务通常由超出我们测试范围的某个外部扩展程序调用
  4. A warning related to a conflict in culture settings (AssemplyInfo.cs-> AssemblyCulture) between referenced projects (also not sure if this could affect, as when doing normal publish without merging pages & controls assemblies we don't have any issue) 与引用的项目之间的区域性设置(AssemplyInfo.cs-> AssemblyCulture)中的冲突有关的警告(也不确定这是否会影响,因为在不合并页面和控件程序集的情况下进行正常发布时,我们没有任何问题)

Regards, 问候,

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM