加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

如何识别asp.net Web应用程序中的iisreset?

发布时间:2020-12-16 07:09:13 所属栏目:asp.Net 来源:网络整理
导读:我有一个应用程序需要在启动时做一些工作(在第一个请求进入之前). 我在global.asax文件(Application_start方法)中添加了初始化代码,但是在执行iis重置后,这段代码似乎没有被命中. 当iis重置时,是否有一个在asp.net应用程序中触发的事件? 谢谢. 解决方法 htt
我有一个应用程序需要在启动时做一些工作(在第一个请求进入之前).
我在global.asax文件(Application_start方法)中添加了初始化代码,但是在执行iis重置后,这段代码似乎没有被命中.
当iis重置时,是否有一个在asp.net应用程序中触发的事件?

谢谢.

解决方法

http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx

这可能对你有所帮助.

这些功能是IIS 7.5的新功能,仅适用于Windows Server 2008 R2 / Windows 7.

Auto-Start Web Applications with ASP.NET 4

Some web applications need to load large amounts of data,or perform expensive initialization processing,before they are ready to process requests. Developers using ASP.NET today often do this work using the “Application_Start” event handler within the Global.asax file of an application (which fires the first time a request executes). They then either devise custom scripts to send fake requests to the application to periodically “wake it up” and execute this code before a customer hits it,or simply cause the unfortunate first customer that accesses the application to wait while this logic finishes before processing the request (which can lead to a long delay for them).

ASP.NET 4 ships with a new feature called “auto-start” that better addresses this scenario,and is available when ASP.NET 4 runs on IIS 7.5 (which ships with Windows 7 and Windows Server 2008 R2). The auto-start feature provides a controlled approach for starting up an application worker process,initializing an ASP.NET application,and then accepting HTTP requests.

编辑:链接到有关自动启动功能的更多信息.

http://www.asp.net/LEARN/whitepapers/aspnet4#0.2__Toc253429241

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读