【发布时间】:2012-08-01 21:20:56
【问题描述】:
我在 IIS 7 上有一个 .NET 4.0 应用程序,其中包含一个嵌套的 .NET 2.0 应用程序。问题是嵌套的 .NET 2.0 应用程序在 web.config 的 <configSections> 中有 system.web.extensions sectionGroup,而 .NET 4.0 父应用程序 machine.config 也包含这些 sectionGroups。这会导致状态码 500 服务器错误。
从子应用程序 web.config 中注释掉 system.web.extensions sectionGroup 是可行的,但不是我们设置的选项。
如何防止在子应用程序中继承父 web.config?我已经看到 <location path="." inheritInChildApplications="false"> 在以前的 .NET 版本中使用过,但是我应该用什么包裹 location 元素呢?
Intellisense 向我显示“不允许使用 inheritInChildApplications 属性”,我将它放在哪里似乎并不重要。
【问题讨论】:
标签: c# iis inheritance web-config location