Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are scenarios that trigger Application_End event?

Asp.net has an Application_End event which occurs when the application comes to end, like this

void Application_End(object sender, EventArgs e)
{
}

My question is the following: when does this event occurs in real, i.e. what kind of situations trigger it?

Suppose I have a banking web application running 24x7x365, which executes continuously & accesses from thousands of places at a time, then when would this Application_End event occur? What kinds of situations are responsible for this?

like image 643
Ravindra Bagale Avatar asked Nov 04 '12 10:11

Ravindra Bagale


2 Answers

The Application_End event gets fired when the IIS pool is recycled or when you make changes to the bin folder or web.config file. You should change the default IIS setting to schedule a recycle once a day on offpeak hours.

like image 82
Stefan P. Avatar answered Oct 19 '22 22:10

Stefan P.


It will be fired in one of those situations:

  1. IIS pool is restarted.

  2. Web.config changes.

  3. Application is restarted.

like image 28
ronen Avatar answered Oct 19 '22 22:10

ronen