【发布时间】:2014-10-19 16:43:26
【问题描述】:
我有一个使用 ELMAH 的父 IIS 应用程序和一个不使用 ELMAH 的子 ASP.NET 应用程序(虚拟目录)。当我尝试浏览我的子应用程序时,我收到此错误:
无法加载文件或程序集“Elmah”或其依赖项之一。系统找不到指定的文件。
这是可以理解的,因为我的子应用程序的 bin 文件夹不包含任何 ELMAH 程序集。
问题可能是父 web.config 文件包含以下内容:
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
</configSections>
据我了解,没有办法阻止<configSections> 继承,请参阅例如How to stop inheritance of <configSections>in Web.Config。那么有没有办法运行我的无 ELMAH 子应用程序?
【问题讨论】:
标签: asp.net elmah web-config