I know that in the following cases Apllication_end will be called:
- edit the config file for an application that's running.
- change a dll in the bin directory.
- stop (or restart) IIS.
- Process Recycling turned on either in IIS6 App Pools, or using the aspnet worker process.
but my question is what are the cases when it's won't be called?
I know it won't be called if you manually End w3wp process or if the server will brutally shut down.
Is there any other scenarios?
Thanks!
It seems that the brutal shut down can be caused by OutOfMemoryException that caused failure in creating AppDomain that are needed for executing requests. In this scenario Application_end won't be called.
for further reading on IIS and AppDomains look at: http://weblogs.asp.net/owscott/archive/2007/09/02/application-vs-appdomain.aspx