gpt4 book ai didi

asp.net - 如何在ASP.NET Web应用程序中识别iisreset?

转载 作者:行者123 更新时间:2023-12-04 18:15:23 25 4
gpt4 key购买 nike

我有一个需要在启动时做一些工作的应用程序(在第一个请求进入之前)。
我已经在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

关于asp.net - 如何在ASP.NET Web应用程序中识别iisreset?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4539282/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com