Rodrigo Gama Rodrigo Gama - 15 days ago 5
ASP.NET (C#) Question

Asp.NET Global.asax - application lifecycle

I am using Visual Studio 2005, and running my application from inside it, directly using its development application server.

If I set a breakpoint inside Application_Start and one inside Session_Start, the latter is reached first, and I honestly think it should be the other way around.

Any thoughts?

Answer

by default, the Application_Start event will not be hit again whilst running the application unless the web development server is stopped and restarted.

There's a setting in Visual Studio to force the web development server process to be recycled on each launch. Simply right-click the project file > Web > check Enable Edit and Continue. This forces a recycle of the ASP.Net Web Server process on every debug run.