网站抛出"NotImplementedException"的状态属性;在IIS Express中 [英] State property of Site throwing "NotImplementedException" in IIS Express

查看:119
本文介绍了网站抛出"NotImplementedException"的状态属性;在IIS Express中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Microsoft.Web.Administration.dll通过使用以下代码来检查我的网站的状态.它在IIS上正常工作,但是在IIS Express中使用时,状态"属性将引发"NotImplementedException".

I am using Microsoft.Web.Administration.dll to check states of my sites by using following code. It works fine with IIS but when it's used in IIS Expresss, then 'State' property throws 'NotImplementedException'.

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

有人遇到这个问题吗?

推荐答案

对于IISExpress,似乎未实现属性"State".我试图使用反编译器搜索此属性的实现,但找不到它.似乎很多代码都隐藏在COM dll的层之下.

It seems for IISExpress, property 'State' is not implemented. I tried to use de-compilers to search for implementation of this property but couldn't find it. It seems lot of code is hidden underneath the layers of COM dlls.

所以,现在我不使用此属性.

So, for now I am not using this property.

这篇关于网站抛出"NotImplementedException"的状态属性;在IIS Express中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆