无法继续活着的IIS Web应用程序或回收后重新启动 [英] Cannot keep alive Web Application on IIS after Recycling or Restarting

查看:360
本文介绍了无法继续活着的IIS Web应用程序或回收后重新启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有定期使用 Quartz.NET 发送电子邮件的 MVC 应用程序。尽管发布的应用程序上正常工作 IIS ,它不能回收应用程序池或重新启动对 IIS 申请后的作品。搜索在网络上我发现了几个建议后作出的配置文件或 IIS 一些变化,但他们的正常工作。那么,有没有任何解决问题的方法?我需要,可以在应用程序侧施加(或在IIS侧如果是简单的仅仅是配置的变化,等)中的溶液。我认为这对保持 IIS 应用程序时是一个常见的​​问题,是不是?


注意:我使用的是Windows Server 2008和IIS 7.5

I have an MVC application that send an e-mail periodically using Quartz.NET. Although the published application works properly on IIS, it cannot works after recycling application pool or restarting the application on IIS. Searching on the web I found several post suggesting to make some changes on config files or IIS, but none of them working properly. So, is there any method to solve the problem? I need a solution that can be applied on application side (or on IIS side if it is simple just making a config changes, etc.). I think this is a common problem when keeping an application on IIS, isn't it?
Note: I use Windows Server 2008 and IIS 7.5.

推荐答案

在您的应用程序要这么办的我猜测它会在内部托管你不会在你的问题提了。

You do not mention in your question where your application is going to run so I guess it's going to be hosted in-house.

随着您的评论我猜你没有安装和您的服务器上运行的Windows服务的任何问题。

Following your comment I gather you do not have any problems installing and running a Windows Service on your server.

我的建议 - 这是我已经在过去实现的 - 是使用ASP.NET MVC应用程序只在您创建一个用户界面,删除或暂停您的工作/触发器将在数据库中坚持如此,无论发生在你的应用程序时,你不会失去你的工作/触发器和应用可以追溯到上线,他们将尽快执行。

My suggestion - and something I've implemented in the past - is to use the ASP.NET MVC application only as a UI where you create, delete or suspend your jobs/triggers which will be persisted in a database so, whatever happens to your application, you won't lose your jobs/triggers and they will be executed as soon as the application goes back on-line.

该数据库将与其他层,Windows服务,这将是负责运行预定作业共享。

The database will be shared with the other layer, the Windows Service, which will be responsible for running your scheduled jobs.

第一步是设置和使用 AdoJobStore 来存储数据Quartz.Net。正如你可以在后看到有可以使用的一些供应商。

First step is to setup and use AdoJobStore to store Quartz.Net data. As you can see in the post there are a few providers you can use.

第二步是创建和配置Windows服务。我会用 TopShelf 主办的。实现是非常简单明了;再加上你可以使用Quartz.Net整合提供 rel=\"nofollow\">。

Second step is to create and configure your Windows Service. I would use TopShelf to host it. The implementation is very simple and straightforward; plus you can use the Quartz.Net integration provided here.

如果您通过文档,你不会找到集成解决方案的任何问题。

If you go through the documentation you won't find any problem integrating the solution.

Quartz.Net取决于一些配置,你必须在的app.config / web.config中补充。在此回答有关于配置和AdoJobStore一个详细的解释。

Quartz.Net depends on some configuration you have to add in your app.config/web.config. In this answer there's a detail explanation about the configuration and AdoJobStore.

有几件事情要记住实现这种类型的解决方案。结果
Web应用程序是要设置属性线程池 ZeroSizeThreadPool 在你的配置:

There are a few things to remember implementing this type of solution.
Your Web Application is going to set the property threadPool to ZeroSizeThreadPool in your config:

<add key="quartz.threadPool.type" value="Quartz.Simpl.ZeroSizeThreadPool, Quartz" />

或你的code:

properties["quartz.threadPool.type"] = "Quartz.Simpl.ZeroSizeThreadPool, Quartz";

和它永远不会启动调度程序(你的windows服务将使用)。

and it's never going to start the Scheduler (your windows service is going to use that).

这篇关于无法继续活着的IIS Web应用程序或回收后重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆