2014-05-05 48 views
3

我正在使用Microsoft.Web.Administration.dll通過使用以下代碼來檢查我的網站的狀態。它適用於IIS,但在IIS Express中使用時,'State'屬性會拋出NotImplementedException在IIS Express中拋出「NotImplementedException」的網站的狀態屬性

這裏是我的代碼

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

有沒有人遇到這個問題?

回答

4

看來IISExpress的屬性'State'沒有實現。我試圖使用反編譯器來搜索此屬性的實現,但無法找到它。似乎很多代碼隱藏在COM dll層下面。

所以,現在我不使用這個屬性。

相關問題