Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# “场地抛掷的状态属性”;“未实施例外情况”;在IIS Express中_C#_Asp.net_Iis Express_Web Administration - Fatal编程技术网

C# “场地抛掷的状态属性”;“未实施例外情况”;在IIS Express中

C# “场地抛掷的状态属性”;“未实施例外情况”;在IIS Express中,c#,asp.net,iis-express,web-administration,C#,Asp.net,Iis Express,Web Administration,我正在使用Microsoft.Web.Administration.dll通过以下代码检查我的网站的状态。它在IIS中工作正常,但在IIS表达式中使用时,“State”属性会抛出“NotImplementedException” ServerManager manager = new ServerManager() foreach (Site site in manager.Sites){ If (site.State == ObjectState.Started) {

我正在使用Microsoft.Web.Administration.dll通过以下代码检查我的网站的状态。它在IIS中工作正常,但在IIS表达式中使用时,“State”属性会抛出“NotImplementedException”

ServerManager manager = new ServerManager()
foreach (Site site in manager.Sites){
   If (site.State == ObjectState.Started)
   {
        .....
   }
}

有人遇到过这个问题吗?

对于IISExpress,似乎没有实现属性“State”。我尝试使用反编译器搜索此属性的实现,但找不到它。似乎很多代码都隐藏在COM DLL层的下面


因此,目前我没有使用此属性。

从GAC自动加载的程序集Microsoft.Web.Administration.dll(即使您引用IIS程序集)是IIS Express模块,并且未实现属性“状态”

您应该接受此答案。由于IIS Express不是IIS,因此许多MWA API不适用于它。