Application_End global.asax

ε祈祈猫儿з 提交于 2019-11-26 17:49:22

问题


Can anybody tell me when Application_End is triggered in a lifecycle of an application? When all sessions are ended, will Application_End be triggered automatically? + Are there any other reasons why Application_End could be triggered?


回答1:


The application_end event primarily fires when the IIS pool is recycled or the application itself is unloaded. One other thing to note, that a change to a dependent file (say web.config) will cause the application to reload itself, which will in cause the application_end event to fire while it is closing itself off.

To note, the only instance I found of the application end event firing when the last user session times out is in some old documentation dated 2001. I'm not sure if that criteria still applies.




回答2:


Application_End is triggered when the ASP.NET worker process terminates. This usually occurs after a configurable period of inactivity or when IIS (or the relevant application pool) is shut down or restarted.

When running in IIS 6.0, the inactivity timeout is configurable through the application pool settings in Internet Services Manager (Idle Timeout on the Performance tab). Under earlier versions of IIS it can be set in machine.config (idleTimeout under processModel).



来源:https://stackoverflow.com/questions/288350/application-end-global-asax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!