1

I initialize static state of my web applications in Applications_Start method (Global.asax). At that time I write a message to log. Suddenly I've realized that this method was called every 10 minutes.

Is it corrected behavior? I expected ASP.NET to keep its applications at least for several hours.

Alex Kofman
  • 2,153
  • 19
  • 20

2 Answers2

1

Your expectation is incorrect. This is set in the application pool setting in IIS configuration. I think the default is 20 minutes. This can be changed to 0 if the application pool should not be recycled.

kubal5003
  • 7,186
  • 8
  • 52
  • 90
0

This is not typical. Something is causing it to restart and it should not be doing so this frequently. Check out How to find out why an ASP.NET web application is being restarted question to see how you can log details on why it restarted.

Since you are writing out log files, maybe you are writing them to a location that is be monitored for recompilation, which will cause a appdomain restart. Check out the post What causes an application pool in IIS to recycle?

Check out this article on iis.net to see the default for recycleing. It is 29 hours, so unless this setting has been changed for you, something else is causing it, not the automatic recycle.

Community
  • 1
  • 1
Mike Ohlsen
  • 1,900
  • 12
  • 21