简体   繁体   English

在IIS中回收应用程序池时,是否调用Application_End?

[英]When an application pool is recycled in IIS, is the Application_End called?

I have some clean up stuff in Application_End method in Global.asax. 我在Global.asax的Application_End方法中有一些清理工作。 When an application pool is recycled in IIS, is the Application_End called? 在IIS中回收应用程序池时,是否调用Application_End? or do I need to place the clean up code in any other function? 还是我需要将清理代码放置在任何其他函数中?

One thing is certain dispose gets called before Applicaion_End. 一件事是某些处置在Applicaion_End之前被调用。 After adding logging to Application_End to show you that it does indeed get called by recycle, see what happens when you add an infinite loop to dispose. 在向Application_End添加日志以显示确实确实被回收调用后,请查看添加无限循环进行处理时会发生什么。 Does End get called? 结束会被呼叫吗?

You should also note that Application_End gets is supposed to be called when ever the AppDomain gets unloaded. 您还应该注意,应该在卸载AppDomain时调用Application_End gets。 This includes things like web.config changes. 这包括对web.config的更改。

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

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