相关疑难解决方法(0)

如何防止"configSections"的web.config文件继承?

我在我的父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">,因为配置部分应该是配置文件的第一个子元素

c# asp.net visual-studio-2010 visual-studio

14
推荐指数
2
解决办法
1万
查看次数

"已经添加了条目" - 两个独立的应用程序池

我正在创建现有生产站点的测试版本.站点内部存在虚拟Web服务应用程序 - 两个Web配置具有相同的连接字符串.

生产Web配置中没有"清除"标记,并且站点和Web服务在两个单独的应用程序池上共存.

但是,在测试站点上,每次浏览到Web服务URL时,都会收到配置错误"已添加条目'ConnectionString'."

测试站点和相应的虚拟应用程序使用自己独立的应用程序池.有任何想法吗?

谢谢吉姆

application-pool asp.net-mvc-4

7
推荐指数
1
解决办法
4607
查看次数

configSections是否为web.configInheritInChildApplications =“ false”?

我在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属性”,并且在我放置它的位置似乎无关紧要。

c# iis inheritance location web-config

3
推荐指数
1
解决办法
2万
查看次数