如何发现ASP.NET应用程序重启的原因 [英] How to discover the reason of ASP.NET application restart

查看:251
本文介绍了如何发现ASP.NET应用程序重启的原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来监视(日志)用于重新启动ASP.NET应用程序的原因是什么?

我们现在具有相当复杂的网站的问题。它的文件上传过程中重新启动。不是每一个文件,但每5 - 10是肯定的。我们使用自定义的VirtualPathProvider,因此这可能是一个原因。我们也有一个背景工作线程,这也可能是一个原因。这将是巨大的,只知道其中的原因。

在XP(IIS 5.1)和Windows Server 2003出现问题(IIS 6)。

分辨率:

谢谢你们,我们已经成功地抓住它。它是由达到最大重新编译引起的。最有可能的问题是,在我们的VirtualPathProvider,但是这是完全不同的问题。

办法总结:


  1. 哈克在ScottGu的博客都运行完美。

  2. 通过machine.config中监控也很大,但我preFER把它登录到我们的日志。

  3. 事实证明,简单的办法是在我的 Application_End 方法来检查 HostingEnvironment.ShutdownReason 属性。


解决方案

让你看着从记录的建议的记录ASP.NET应用程序关闭事件」?这将是我的建议的方式来获得所发生的事情的更多信息。

Is there a way to monitor (log) the reason for restarting of an ASP.NET application?

We now having problem with rather complex site. It's restarting during file upload. Not on every file, but on every 5th-10th for sure. We use custom VirtualPathProvider, so this could be a reason. We also have a background worker threads, and this also could be a reason. It would be great to just know the reason.

Problem occurs on XP (IIS 5.1) and Windows Server 2003 (IIS 6).

Resolution:

Thanks guys, we've managed to catch it. It is caused by max recompilations reached. Most likely the problem is in our VirtualPathProvider, but this is completely different question.

Summary of approaches:

  1. Hack in ScottGu's blog works perfect.
  2. Monitoring via machine.config is also great, but I prefer to log it into our log.
  3. As it turned out, simplest solution is to check HostingEnvironment.ShutdownReason property in my Application_End method.

解决方案

Have you looked at the logging suggestions from "Logging ASP.NET Application Shutdown Events "? That would be my suggestion for a way to get more information about what is happening.

这篇关于如何发现ASP.NET应用程序重启的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆