How can I get status/state of WebSite and/orAppPool ?

Feb 11, 2011 at 11:55 AM
Edited Feb 11, 2011 at 11:56 AM

I use vs 2008, .net 3.5, winxp client, win2003 server, IIS 6.0, msbuild.

Key for me:

Using MSBuild Extension Pack., how can I know the status/state (Started, Stopped, ...) of WebSite or AppPool (IIS6) ??

Iis6WebSite and IIs6AppPool (and future for IIS7), do wait for stopped status when try Stop WebSite or AppPool ?

Feb 11, 2011 at 12:02 PM

You can't. Why do you need to do this? It's something that could be looked at for the next release if necessary.


Feb 11, 2011 at 12:56 PM


<MSBuild.ExtensionPack.Web.Iis6Website TaskAction="Stop" Name="$(SitioWeb)" />


When I execute Stop Action for WebSite (or Stop Action for AppPool), I need be sure 100% that WebSite is Stopped, and then, and only if WebSite is Stopped, I can execute other targets.

I think, get State is very very useful

Feb 11, 2011 at 1:55 PM

Ok, I've added a new TaskAction="GetMetabasePropertyValue". I'll extend that to the other tasks. I've found stop to be pretty quick. What's your plan? use a Sleep? I could add a wait into the task if that helps.



Feb 14, 2011 at 7:45 AM
Edited Feb 16, 2011 at 1:25 PM

The plan is a task that Stop WebSite (or AppPool) and waits until state Stopped.

the same task for Start WebSite (or AppPool) and waits until state Started.

It will be Action="StopAndWaitForStatus", Action="StartAndWaitForStatus" ??

 How I get the state using GetMetabasePropertyValue ?