vb.net 哪些场景会触发 Application_End 事件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13217704/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 11:00:57  来源:igfitidea点击:

What are scenarios that trigger Application_End event?

c#asp.net.netvb.netevents

提问by Ravindra Bagale

Asp.net has an Application_Endevent which occurs when the application comes to end, like this

Asp.net 有一个Application_End在应用程序结束时发生的事件,像这样

void Application_End(object sender, EventArgs e)
{
}

My question is the following: when does this event occurs in real, i.e. what kind of situations trigger it?

我的问题是:这个事件是什么时候真正发生的,即什么样的情况会触发它?

Suppose I have a banking web application running 24x7x365, which executes continuously & accesses from thousands of places at a time, then when would this Application_Endevent occur? What kinds of situations are responsible for this?

假设我有一个正在运行的银行 Web 应用程序24x7x365,它连续执行并一次从数千个地方访问,那么此Application_End事件何时会发生?什么样的情况是造成这种情况的原因?

回答by Stefan P.

The Application_Endevent gets fired when the IIS pool is recycled or when you make changes to the bin folder or web.config file. You should change the default IIS setting to schedule a recycle once a dayon offpeak hours.

Application_End当回收 IIS 池或更改 bin 文件夹或 web.config 文件时,将触发该事件。您应该更改默认的 IIS 设置,以便在非高峰时段安排每天一次的回收。

回答by ronen

It will be fired in one of those situations:

它将在其中一种情况下被触发:

  1. IIS pool is restarted.

  2. Web.config changes.

  3. Application is restarted.

  1. IIS 池重新启动。

  2. Web.config 更改。

  3. 应用程序重新启动。