【发布时间】:2013-11-12 15:55:49
【问题描述】:
是否可以检测到 Razor 2 网页应用程序 (asp.net) 何时被卸载 - 例如,由于 IIS/WebMatrix 被停止?
有_AppStart.csthml 来处理应用程序的启动。
“应用程序停止”有类似的东西吗?
编辑:
声誉低,我自己还不能投票/回答。
我添加了 Global.asax,确实有用于处理应用关闭的 Application_End 事件。
我可以改用它吗,还是首选您的方法?
void Application_End(object sender, EventArgs e)
{
// Code that runs on application shutdown
}
【问题讨论】: