问题描述
我们正在做一些高速缓存操作在应用程序中的Application_Start阶段。因此,所有的缓存会消失的应用程序池重新启动时。是否有可能引发的Application_Start当应用程序池重新启动或者你有更好的想法来解决这个问题?
We are doing some caching operations in the application_start phase in the application. So all the cache is going away when the application pool restarts. Is it possible to trigger application_start when the application pool restarts or do you have better ideas to solve this problem ?
推荐答案
您可以使用应用程序的初始化IIS 7.5 ,它借用了IIS8功能,或者如果您使用的是ASP.NET 4.0 +有应用程序自动启动。
You could use Application Initialization for IIS 7.5, it borrows functionality from IIS8, or if you are using ASP.NET 4.0 + there is application auto start.
有关ASP.NET 2.0 I 3.5有一个海事组织有点hackish的解决方案,可以在事件日志中记录的应用程序池回收,然后在事件日志设置将在该事件执行的任务,这里有详细信息
For ASP.NET 2.0 i 3.5 there is a IMO somewhat hackish solution, you can log application pool recycle in Event log and then in event log set a task that will be performed on that event, here are the details
这篇关于运行的Application_Start立即在应用程序池重新启动IIS中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!