ASP.NET HttpContext.Current.Application Lifespan
I have a web service that is tracking a user across operation calls. I'm storing my users' information in the HttpContext.Current.Application variable, which is a HttpApplicationState. I've noticed that sometimes, my key is开发者_StackOverflow中文版 there, sometimes it is not. Because of this, I assume that the duration of my application state is expiring.
Is there a way to configure this? If so, how?
THank you!
After x minutes of idle time, IIS will terminate the worker processes. I assume that HttpApplicationState will then be lost.
You can disable idle timeout, see How to prevent/extend idleTimeout in IIS 7?
The application will be unloaded through the iss after a idle time. You can set this idletime to 0 in the properties of the application pool. With the setting 0 the iis will never unload your app.
精彩评论