I'm using ServerManager
to manage app sites and app pools remotely. However there are no methods to control or query the status of an actual application.
I have code for app pool
public string StopAppPool(string poolName)
{
using (var iis = ServerManager.OpenRemote(this._server))
{
return iis.ApplicationPools.First(ap => ap.Name == poolName).Stop().ToString();
}
}
and for site
public string StartSite(string site)
{
using(var iis = ServerManager.OpenRemote(this._server))
{
return iis.Sites.First(s => s.Name == site).Start().ToString();
}
}
but the Application level doesn't have those methods at all.
public string StartApp(string site,string path)
{
using (var iis = ServerManager.OpenRemote(this._server))
{
iis.Sites[0].Applications[0]. // not here =(
}
}