static field in ASP.NET MVC
I have 开发者_如何学Gostatic field with large object in ASP.NET MVC controller. For the first request i initialize this field and it is available for the next queries. But after waiting 10-20 minutes this field is null. Have any ideas ? I use ASP.NET MVC 1 and IIS 7.
Thanks in advance...
Your application pool is probably recycling.
You should be populating any globals like this in application_start, that way they will be reloaded on subsequent requests, even if the pool recycles.
By default if there is no activity for a few minutes it will be unloaded, causing the application to have to be reloaded from scratch. You can prevent or reduce the occurances of the application pool recycling by configuring the application pool settings in IIS Administration.
精彩评论