autostart website after web deploy

血红的双手。 提交于 2019-12-25 08:13:12

问题


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.

It works well when I restart the whole app pool but the autostart is not triggered when I web deploy the website

Is there any way to tell IIS to "restart" fully the website after the deploy and not wait for the first request to it ?


回答1:


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



来源:https://stackoverflow.com/questions/38593553/autostart-website-after-web-deploy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!