I have an application made on asp.net MVC 2 and it is on IIS 7.5 on my pc I tried profiling it and I noticed that Application_Start gets called more than once,
does anybody knows why is this happening ?
Asked
Active
Viewed 9,189 times
15

John Smith
- 7,243
- 6
- 49
- 61

Omu
- 69,856
- 92
- 277
- 407
1 Answers
26
The Application_Start
event is fired once when the application domain is loaded. If you see it firing more than once then this would mean that the application restarts. There are multiple reasons an application domain could get unloaded like deleting modifying some of the files like web.config
, the bin
folder, ... Here's an article describing common reasons for application restart.

Glorfindel
- 21,988
- 13
- 81
- 109

Darin Dimitrov
- 1,023,142
- 271
- 3,287
- 2,928
-
5For me, it was writing files to the bin folder. – d512 Aug 31 '16 at 04:13
-
@d512, I was running in a performance issue for 2 days, your simple comment fixed it in few seconds! – Sameh Deabes Feb 25 '18 at 21:36
-
1@SamehDeabes Glad to hear it! Always nice to know you helped somebody out. – d512 Feb 26 '18 at 01:55