我在我的父Web应用程序配置文件中有以下内容
<configuration>
<configSections>
<sectionGroup name="testmodule">
<section name="testmodule" type="RewriteModule.RewriteModuleSectionHandler, RewriteModule"/>
</sectionGroup>
</configSections>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我想防止子子文件夹继承此配置部分应放在哪里
<location path="." inheritInChildApplications="false">,因为配置部分应该是配置文件的第一个子元素
我正在创建现有生产站点的测试版本.站点内部存在虚拟Web服务应用程序 - 两个Web配置具有相同的连接字符串.
生产Web配置中没有"清除"标记,并且站点和Web服务在两个单独的应用程序池上共存.
但是,在测试站点上,每次浏览到Web服务URL时,都会收到配置错误"已添加条目'ConnectionString'."
测试站点和相应的虚拟应用程序使用自己独立的应用程序池.有任何想法吗?
谢谢吉姆
我在IIS 7上有一个.NET 4.0应用程序,其中包含一个嵌套的.NET 2.0应用程序。问题在于,嵌套的.NET 2.0应用程序<configSections>在web.config的内部具有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向我显示“不允许使用InheritedInChildApplications属性”,并且在我放置它的位置似乎无关紧要。