我安排Elmah在一个网站上工作。它在我的本地机器上工作得很好,但是当我把它移到web服务器上时,我得到了这个异常
配置错误
描述:处理服务此请求所需的配置文件时出错。请查看下面的特定错误详细信息,并适当修改您的配置文件。
解析器错误消息:无法识别配置节elmah/security。
源错误:
Line 110: </connectionStrings>
Line 111: <elmah>
Line 112: <security allowRemoteAccess="1" />
Line 113: <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="CadaretGrantConnectionString"/>
Line 114: <!-- Don't log 404 -->
它在第112行显示了一个错误。要让Elmah使用远程访问,应该做些什么?
下面是我的配置
<elmah>
<security allowRemoteAccess="1" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ConnectionString"/>
<!-- Don't log 404 -->
<errorFilter>
<test>
<equal binding="HttpStatusCode" value="404" valueType="Int32"/>
</test>
</errorFilter>
</elmah>
发布于 2010-06-18 23:51:27
这可能是因为您的web服务器正在运行不同版本的IIS。IIS7 (集成管道模式)需要<system.webServer>
部分中的处理程序和模块,而早期版本需要<system.web>
中的处理程序和模块。确保您已将配置添加到正确的部分。有关详细信息,请参阅Elmah not working with asp.net site。
发布于 2010-06-19 00:40:02
为了在elmah中启用远程访问,我不仅要添加
<elmah>
<security allowRemoteAccess="yes" />
</elmah>
设置为
但同时也
<sectionGroup name="elmah">
<section name="security" type="Elmah.SecuritySectionHandler, Elmah" />
</sectionGroup>
添加上面的部分解决了我的问题
发布于 2010-06-18 23:53:56
我使用IIS的经验有限,所以对此持保留态度...
您发布的web.config代码片段看起来是正确的。根据错误消息,在我看来Elmah在你的web服务器上根本不能工作。您是否检查了使用<sectionGroup name="elmah">
块正确启用了Elmah?你检查过elmah.dll是你项目的一部分吗?
(检查<system.webServer>
也很重要,如minimalis's answer中所述,但听起来似乎还不够深入。)
https://stackoverflow.com/questions/3071095
复制相似问题