ASP.NET Application Start Up
Sequence of Start Up Events:
-
- Reading web.config
-
- Executing all methods marked with PreApplicationStartMethodAttribute
-
- Application start event: AutoEventWireup starts to work
-
- Executing all methods marked with PostApplicationStartMethodAttribute
AutoEventWireup:
http://stackoverflow.com/questions/2058621/difference-between-application-start-and-application-onstart methods matching this pattern are searched: ModuleName_EventName, or ModuleName_OnEventName AutoEventWireup: ModuleName_EventName, or ModuleName_OnEventName e.g. Page_Load Application_Start
Example Events:
- Application_OnStart: before first request, after startup
- Application_OnEnd: after last request, before shutdown
- Session_OnStart: before each unique user session, if without cookie, then for every request
- Session_OnEnd: before? user session expires
note: for multiple matches of the same event, the last one wins for example if both Application_Start + Application_OnStart exist, Application_OnStart will be executed because it appears in the code later
Written on January 17, 2017