简体   繁体   English

Hangfire - 在站点运行时部署不会重新加载应用程序 c# asp.net mvc

[英]Hangfire - deploy while site is running doesnt reload the app c# asp.net mvc

I gather this might be a general asp.net question as well.我认为这也可能是一个一般的 asp.net 问题。 I'm running hangfire and we have noticed that when we publish the app to the site that is acting as a container for hangfire, the deploy causes the app to stop running and the app never 'restarts'.我正在运行 hangfire,我们注意到当我们将应用程序发布到充当 hangfire 容器的站点时,部署会导致应用程序停止运行并且应用程序永远不会“重新启动”。 I have logging in the global asax application_start and application_end, and our applicationpreload.cs.我已经登录了全局 asax application_start 和 application_end,以及我们的 applicationpreload.cs。 When we publish the site I see logs for the application_end event but nothing for the start event - this publish occurs while the site is running.当我们发布站点时,我会看到 application_end 事件的日志,但没有看到 start 事件的日志 - 此发布发生在站点运行时。

I have followed the steps on the hangfire site https://docs.hangfire.io/en/latest/deployment-to-production/making-aspnet-app-always-running.html and there are a few msdn articles I have followed on the newer IIS settings to keep the app pool always running and the site auto start enabled but my assumption is that these only help when there is either an iis site restart, or app pool recycle/stop/start, or a request comes into the site itself.我已经按照 Hangfire 网站https://docs.hangfire.io/en/latest/deployment-to-production/making-aspnet-app-always-running.html上的步骤进行了操作,并且我遵循了一些 msdn 文章在较新的 IIS 设置上,以保持应用程序池始终运行并启用站点自动启动,但我的假设是,这些仅在 iis 站点重新启动或应用程序池回收/停止/启动或请求进入时才有帮助网站本身。 My scenario is that we are using iis as the container, there are no requests hitting the site and we publish while the app is running...我的场景是我们使用 iis 作为容器,没有请求访问站点,我们在应用程序运行时发布......

I was also under the impression that changing files within the iis directory would cause the app pool to recycle but have now realize this is not the case (and that actually makes sense).我还认为更改 iis 目录中的文件会导致应用程序池回收,但现在意识到情况并非如此(这实际上是有道理的)。 We are using asp.net mvc 5, iis 10.我们正在使用 asp.net mvc 5, iis 10。

Any help here would be appreciated!!!!任何帮助在这里将不胜感激!!!!

PS I can see the down votes already on this - which is actually quite comical taking into consideration this question covers some fundamental asp.net knowledge... and yes I'm just being honest here in terms of not knowing the answer :) PS,我已经可以看到对此的反对票了-考虑到这个问题涵盖了一些基本的asp.net知识,这实际上很可笑……是的,我只是在这里说实话,不知道答案:)

thanks谢谢

经过大量测试不同的解决方案变体后,我解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM