我在默认IIS站点的web.config文件中有以下代码。
<httpModules>
<add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="ChartStreamHandler"/>
</httpModules>
然后,当我设置并浏览到一个虚拟目录时,我得到这个错误
无法加载文件或程序集“图表”或其依赖项之一。系统找不到指定的文件。
虚拟目录继承了默认web.config中的模块。
如何停止这种继承?
发布于 2008-09-01 11:19:04
我找到了答案。将HttpModule部分包装在位置标记中,并将inheritInChildApplications属性设置为false。
<location path="." inheritInChildApplications="false">
<system.web>
<httpModules>
<add type="MDL.BexWebControls.Charts.ChartStreamHandler,Charts" name="ChartStreamHandler"/>
</httpModules>
</system.web>
</location>
现在,任何虚拟目录都不会继承此位置部分中的设置。
@GateKiller这不是另一个网站,它是一个虚拟目录,所以会发生继承。
@petrich我在使用<remove />
的时候有过命中和错过的结果。我必须记得将它添加到每个虚拟目录中,这是一件痛苦的事情。
发布于 2008-09-01 11:19:58
将以下内容添加到虚拟目录的web.config文件中:
<httpModules>
<remove name="ChartStreamHandler"/>
</httpModules>
发布于 2008-09-01 11:22:46
According to Microsoft,则其他网站不会继承默认网站的设置。您是说您正在编辑与machine.config位于同一文件夹中的默认web.config吗?
https://stackoverflow.com/questions/37759
复制相似问题