【发布时间】:2013-03-25 23:53:38
【问题描述】:
我从用 C# 编写的 Windows 服务调用以下代码:
try
{
ServerManager m = new ServerManager();
if(m != null)
{
SiteCollection sites = m.Sites; //I get exception here
}
}
catch (Exception ex)
{
}
我得到了这个例外:
{"文件名:redirection.config\r\n错误:无法读取配置 文件\r\n\r\n":null}
这是什么意思?有什么方法可以在 ServerManager 或我的 m 变量中预测它,然后再抛出它?
【问题讨论】:
-
@Artru:这不是一个 ASP.NET 项目。我从 Windows 服务调用它。