简体   繁体   English

当我们从IIS重新启动网站时,将触发哪个事件

[英]Which event will be triggered when we RESTART Website from IIS

Guess I had explained the question wrongly. 猜猜我错误地解释了这个问题。 Which event will be triggered when we restart Website from IIS Manager -> Sites -> Right Click on the website -> Manage Web Site -> Restart 当我们从IIS管理器中重新启动网站->网站->右键单击网站->管理网站->重新启动时,将触发哪个事件

According to the ASP.NET Application Life Cycle Overview 根据ASP.NET应用程序生命周期概述

Application_Start: Called when the first resource (such as a page) in an ASP.NET application is requested. Application_Start:当请求ASP.NET应用程序中的第一个资源(例如页面)时调用。 The Application_Start method is called only one time during the life cycle of an application. 在应用程序的生命周期中,仅一次调用Application_Start方法。 You can use this method to perform startup tasks such as loading data into the cache and initializing static values. 您可以使用此方法执行启动任务,例如将数据加载到缓存中并初始化静态值。

Accoding to above, the application pool start or recycle will trigger the Application_Start method. 按照以上所述,应用程序池的启动或回收将触发Application_Start方法。

So when you start,recycle the application, update some of the files in the bin folder or update the web.config, the Application_Start will be fired next time when a request comes in. 因此,当您启动,回收应用程序,更新bin文件夹中的某些文件或更新web.config时,下次收到请求时,将触发Application_Start。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM