How can I programmatically stop or start a website in IIS (6.0 and 7.0) using MsBuild?
问题 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 this: Stop a website in IIS 6 (or an Application in IIS 7), not stop AppPool. Check if the website is stopped; not running. If the website is stopped, do another task for deploy. Start the website IIS 6 (or Application in IIS 7), How can I achieve this? Update: Key for me: IIS6WebSite and IIS6AppPool (and for IIS7), do wait for