我使用Microsoft.Web.Administration.dll通过使用以下代码检查我的网站的状态.它适用于IIS,但是当它在IIS Express中使用时,'State'属性会抛出'NotImplementedException'.
ServerManager manager = new ServerManager()
foreach (Site site in manager.Sites){
If (site.State == ObjectState.Started)
{
.....
}
}
Run Code Online (Sandbox Code Playgroud)
有人遇到过这个问题吗?