How can I programmatically stop or start a website in IIS (6.0 and 7.0) using MsBuild?

后端 未结 3 1401
我寻月下人不归
我寻月下人不归 2020-12-01 01:24

I have Windows Server 2003 (IIS 6.0) and Windows Server 2008 (IIS 7.0) servers, and I use MSBuild for deploying web applications.

I need to do a safe deploy, and do

3条回答
  •  时光取名叫无心
    2020-12-01 02:12

    • Write a script, e.g. PowerShell, which will stop/start IIS web site programmatically relying on command-line argument, e.g. start-stop.ps1 /stop 1

    • Put it into MsBuild script as a custom step


    Check this to find out how to restart IIS AppPool

    IIS WMI objects reference

提交回复
热议问题