Last post Oct 11, 2011 06:34 AM by akhhttar
Oct 11, 2011 04:23 AM|akhhttar|LINK
I want to know when does Application_End event fires? OR When does IIS unload the asp.net Application?
Previously, I had an understanding that Application_End event fires when there is no single session is established with the application.
But I have recently done a test that if I disable the Application Pool's Idle timeout and recyling then the Applications runs under that Application Pool is always loaded in asp.net worker process and Application_End never fires for those applications. As per
my understanding that these Application Pool settings can only help us to make asp.net worker processor alive for long time but it doesn't mean that all Applications under that application pool should also be loaded in IIS all the time.
Here are some details about the test that I have executed,
I added the loggging calls in Application and Session Start and End events then I logged-in in the application and then logged off. Application Start, Session Start and Session End event fired and logged into the log file but Application_End was not fired.
As per my understanding that Application_End event should also be fired after some time as there is no more session established with the Application, I waited for one hour but I didn't fire.
Can someone please help me to understand this behavior?
Oct 11, 2011 05:16 AM|DarrellNorton|LINK
As I've learned myself, the MSDN documentation is wrong. Application_End is only called when something causes the app to restart "gracefully." In other words, you change a DLL in the bin directory, you change the web.config, etc.
See this post for all the scenarios:
Oct 11, 2011 06:34 AM|akhhttar|LINK
Thank you Darrel for you replay.
You are right, it seems that MSDN documentation is wrong about Application_End event.