Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 28058

Exception while trying to query IIS from C# service

$
0
0

I'm calling the following code from Windows service that was written with C#:

try
{
 ServerManager m = new ServerManager();
 if(m != null)
 {
 SiteCollection sites = m.Sites; //I get exception here
 }
}
catch (Exception ex)
{
}

I get this exception:

{"Filename: redirection.config\r\nError: Cannot read configuration file\r\n\r\n":null}

What does that mean? And is there any way to predict it in ServerManager or my 

m
 variable before it's thrown?


Viewing all articles
Browse latest Browse all 28058

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>