Application_End 到底什么时候被调用以及如何手动导致这种情况?

发布于 2024-07-24 05:24:32 字数 225 浏览 2 评论 0原文

我知道当应用程序池被 IIS 回收时会调用该事件的事件处理程序,但是什么时候会发生这种情况呢? 如果使用内置的 Visual Studio 服务器(Cassini)怎么样? 如果我终止服务器进程,Application_End 会被解雇吗?

更新:我知道 web.config 和 BIN 文件夹的更改。 我对应用程序空闲一段时间而没有接触任何东西后关闭池的情况感兴趣。

I know that the event handler for this event is called when the application pool is recycled by IIS, but when does that happen? What about if using the built-in Visual Studio server (Cassini)? If I kill the server process, would Application_End be fired?

UPDATE: I know about web.config and BIN folder changes. I'm interested in the case of shutting down the pool after the application has been idle for a period of time without touching anything.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最美不过初阳 2024-07-31 05:24:32

就像 尼克 说,“当应用程序池配置达到某些回收限制时,应用程序池将回收。” 在 IIS 中,您可以在应用程序池设置中设置回收条件。 您可以使用固定间隔(每 X 分钟或请求)、一天中的特定时间或基于内存的最大值(以 MB 为单位)(最大虚拟内存或最大专用内存),或其中任意值的组合。 您还可以设置空闲超时(以分钟为单位),之后工作进程将终止。

IIS 回收设置

IIS 高级设置

Like Nick said, "An application pool will recycle when... some of the recycle limits are hit on the application pool configuration." In IIS you can set the recycling conditions in the application pool settings. You can use fixed intervals (every X minutes or requests), a specific time of day, or memory-based maximums in MB (max virtual memory or max private memory), or a combination of any of these. You can also set an idle time-out in minutes after which a worker process is terminated.

IIS Recycling Settings

IIS Advanced Settings

温柔一刀 2024-07-31 05:24:32

当您更改 web.config 或 /bin 目录,或者应用程序池配置达到某些回收限制时,应用程序池将回收。 Cassini 也是如此,只是它没有应用程序池,因此只要 web.config 或 /bin 目录发生更改,它就会触发。 我不确定是否要杀死卡西尼号实例。

An application pool will recycle when you change the web.config or the /bin directory, or some of the recycle limits are hit on the application pool configuration. The same is true for Cassini except it doesn't have an application pool, so it will trigger any time the web.config or /bin directory is changed. I am not sure about killing the instance of Cassini.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文