- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我刚刚在读这篇文章 "When is IHttpModule.Dispose method called?"我找到了这个
"The Dispose method performs any final cleanup work prior to removal of the module from the execution pipeline."
which would mean it's application-wide.
It's ok. Anyway trying by myself I found out that using the IHttpModule Dispose method and an event handler for the Application.Disposed event should be barely the same. The first occurs right after the second one.
我觉得这不是 100% 正确,即 IHttpModule.Dispose 并不总是跟在 Application_End 之后。假设我为我的应用程序运行了多个 Application 对象实例,这意味着 Application 对象的每个实例都将在其中包含单独的模块实例。现在让我们假设当应用程序池充满应用程序实例时,会发生什么?它不会开始一个接一个地处理应用程序实例,并在链中处理应用程序实例内的模块。现在这个模块的处理并不意味着 Application_End 将在那之后触发。应用程序仍在运行。我对吗?
最佳答案
是的。
HttpModules 是每个 HttpApplication。与其名称建议相反,global.asax 中的 Application_End 方法不会在每个 HttpApplicaton 的生命周期结束时触发。它在当前 AppDomain 中所有 HttpApplications 的生命周期结束时触发(当 AppDomain 被拆除时)。 Application_Start 方法也是如此。
关于c# - 关于 IHttpModule.Dispose 和 Application_End 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6698766/
我是 C# 的新手,所以请多多包涵。 我有一个函数在 Global.asax.cs 文件的 Application_Start 函数中运行,当我开始调试时它工作正常。 但是当我停止调试时,我在 App
我已阅读 this , this , this和 this加上十几个其他帖子/博客。 我在共享主机中有一个经常回收的 ASP.Net 应用程序。我们使用 NLog 并在 global.asax 中有以
Asp.net 有一个 Application_End 事件,它在应用程序结束时发生,如下所示 void Application_End(object sender, EventArgs e) { }
我知道当 IIS 回收应用程序池时会调用此事件的事件处理程序,但是什么时候发生?如果使用内置的 Visual Studio 服务器 (Cassini) 呢?如果我杀死服务器进程,Application
谁能告诉我在应用程序的生命周期中何时触发Application_End?当所有 session 结束后,Application_End会自动触发吗? + 还有其他原因可能会触发 Application
Application_End() 在我的应用程序池停止时被调用,这种情况的发生可能有多种原因,包括自动池回收或提供应用程序的文件夹发生更改。 调用堆栈通常如下所示: my Application_E
在 Web 或 Api 解决方案中处理像 Autofac 这样的 IOC 容器时,您会看到很多这样的实现代码: protected void Application_Start() { ///
我在 web.config 中有这个条目 我在 Global.asax.cs 中有以下代码以在回收时自动启动 IIS void Application_End(object se
在ASP.NET WebAPI中,global.asax.cs文件中有一种称为ApplicationStart的方法,该方法在应用程序启动时会自动调用。这个怎么称呼? 我问的原因是我想添加一个Appl
删除部署或重新启动实际生产 Web 角色时,不会调用 ASP.NET Web 应用的 Application_End 方法。 卸载应用程序时,我需要执行清理操作(例如删除动态服务总线订阅)。 有什么想
我在Application_Start和Application_End (global.asax)中实现了一些代码。当我启动 ASP.NET Developer Server 时,Applicatio
删除部署或重新启动实际生产 Web 角色时,不会调用 ASP.NET Web 应用的 Application_End 方法。 卸载应用程序时,我需要执行清理操作(例如删除动态服务总线订阅)。 有什么想
我们有一个 MVC ASP.NET Web 应用程序作为应用服务托管在 Azure 上。每天有 3 到 4 次我可以看到它重新启动。我正在 global.asax 中的 Application_End
我在 Application_End 上处理的项目中使用临时数据库: protected void Application_End() { if (_db != null) _db.Dispo
我刚刚在读这篇文章 "When is IHttpModule.Dispose method called?"我找到了这个 "The Dispose method performs any final
我想在停止调试或停止 IIS Express 网站时优雅地处理应用程序关闭,但我似乎无法让 Application_End 运行。 最佳答案 如果您正在使用 IIS Express 进行调试,如果您右
在我的 Azure 环境中,我在实例上有一个包含多个网站的网络角色。 WCF 项目中的 global.asax 中的 Application_Start() 方法被调用多次(中间间隔几分钟),而不会遇
我正在编写一个 http 模块,并且我想添加一个在(且仅当)appdomain 被回收时调用的方法。我不想向 global.asax 添加任何内容,我想在 http 模块中以编程方式执行此操作。 但是
在我的 Azure 环境中,我在实例上有一个包含多个网站的网络角色。 WCF 项目中的 global.asax 中的 Application_Start() 方法被调用多次(中间间隔几分钟),而不会遇
我正在处理的当前应用程序似乎经常回收应用程序池,但是当它结束时,id 没有通过 Application End 或 Application Start。 这就是我的 Global.asax 的样子。
我是一名优秀的程序员,十分优秀!