问题描述
我有一个IIS网站,其中有多个应用程序连接到同一个应用程序池,并且我定期使用msdeploy工具通过Web部署来部署其中一些网站.此应用程序之一设置为自动启动serviceAutoStartEnabled="true"
和匹配的serviceAutoStartProvider
.
I have a IIS website with multiple application connected to the same app pool and I deploy regularly some of those website through web deploy with the msdeploy tool. One of this app is set to autostart with the serviceAutoStartEnabled="true"
and a matching serviceAutoStartProvider
.
当我重新启动整个应用程序池时效果很好,但是当我通过Web部署网站时不会触发自动启动
It works well when I restart the whole app pool but the autostart is not triggered when I web deploy the website
是否有任何方法可以告诉IIS在部署后完全重新启动"网站,而不必等待对它的第一个请求?
Is there any way to tell IIS to "restart" fully the website after the deploy and not wait for the first request to it ?
推荐答案
您可以使用后同步命令:
You could use a post sync command:
msdeploy -verb:sync -preSync:runCommand="net stop w3svc" -source:webserver60 -dest:auto,computername=serverA -verbose -postSync:runCommand="appcmd start site /site.name: contoso"
https://technet.microsoft.com /en-us/library/ee619740(v=ws.10).aspx
这篇关于网站部署后自动启动网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!