运行的Application_Start立即在应用程序池重新启动IIS中 [英] Run Application_Start immediately when application pool restarts in IIS

查看:716
本文介绍了运行的Application_Start立即在应用程序池重新启动IIS中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在做一些高速缓存操作在应用程序中的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 +有<一个href="http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx"相对=nofollow>应用程序自动启动。

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的解决方案,可以在事件日志中记录的应用程序池回收,然后在事件日志设置将在该事件执行的任务,这里有<一href="http://blogs.msdn.com/b/vijaysk/archive/2009/03/10/iis-7-tip-4-application-pool-recycling-events-has-an-ui.aspx"相对=nofollow>详细信息

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中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆