MVC应用程序状态生命周期

时间:2017-06-26 12:22:36

标签: c# asp.net-mvc

在ASP.NET MVC中,您可以使用以下命令将值存储在Application状态中:

HttpContext.Current.Application["example"] = "test";

Application状态的生命周期如何处理。我认为应用程序池回收时它会清除。什么时候清楚?

1 个答案:

答案 0 :(得分:0)

正如this page所述 静态数据有五个原因:

The pool decide that need to make a recompile.
You open the app_offline.htm file
You make manual restart of the pool
The pool is reach some limits that you have define and make restart.
For any reason you restart the iis, or the pool.