当应用程序池被回收时强制应用程序启动的最佳方法是什么?

发布于 2024-09-30 04:17:04 字数 137 浏览 1 评论 0原文

我想知道是否有一种方法可以在回收某个网站/应用程序的应用程序池时自动启动该网站/应用程序的应用程序启动?

对于这个问题有任何现成的解决方案吗?

我真的很想避免让我的最终用户之一必须经历网站的应用程序启动(如果他们可以避免的话)。

I'm wondering if there is a way to automagically fire off an Application Start for a web site/application whenever the Application Pool for that site is recycled?

Are there any canned solutions for this problem?

I would really like to avoid having one of my end users have to go through the application start of the site if they can avoid it.

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

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

发布评论

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

评论(1

尴尬癌患者 2024-10-07 04:17:04

如果您使用的是 .NET 4,则可以。

<applicationPools>
     <add name="MyAppWorkerProcess" managedRuntimeVersion="v4.0" startMode="AlwaysRunning" />
</applicationPools> 

请参阅 ScottGu 的文章 自动启动 ASP.NET 应用程序

除此之外,我听说有人编写服务每隔几分钟发出一次请求。在我看来,有点矫枉过正,但这取决于你的需要。

If you are using .NET 4 you can.

<applicationPools>
     <add name="MyAppWorkerProcess" managedRuntimeVersion="v4.0" startMode="AlwaysRunning" />
</applicationPools> 

See more information at ScottGu's article Auto-Start ASP.NET Applications.

Other than this I have heard of people writing a service to make a request every few minutes. A little overkill, imo, but depends on your need.

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