State property of Site throwing "NotImplementedException" in IIS Express
Asked Answered
P

2

5

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)
   {
        .....
   }
}

Has anyone faced this issue?

Prue answered 5/5, 2014 at 7:45 Comment(0)
P
7

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.

Prue answered 19/5, 2014 at 6:27 Comment(1)
You should accept this answer. As IIS Express is not IIS, many of the MWA API do not apply to it.Lathi
Y
2

The assembly Microsoft.Web.Administration.dll automatically loaded from GAC (even if you reference IIS assembly) is an IIS Express module and not implements property "State"

Yogh answered 22/9, 2018 at 19:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.