I hate IIS today

time to read 1 min | 74 words

I am trying to execute the following piece of code:

Microsoft.Web.Administration.WebConfigurationManager.GetSection("system.webServer/httpHandlers");

Of course, this fails with a completely bizarre exception.

image

For some reason, I have the feeling it is not supposed to do that. Trying to explicitly pass the path where web.config lies also fails. When I finally made it use the correct path, it still gave the same error.

Urgh!