ASP.NET web.confg避免configSections的继承

ASP.NET web.confg避免configSections的继承,asp.net,entity-framework,web-config,iis-7.5,Asp.net,Entity Framework,Web Config,Iis 7.5,这是我的父站点web.config: <configSections> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.E

这是我的父站点
web.config

<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <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" />
    </sectionGroup>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <section name="Duncan.PEMS.Web.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
</configSections>
.....
.....
.....
<entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
.....
.....
.....
<configSections>
    <remove name="entityFramework" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
.....
.....
.....
<entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
        <parameters>
            <parameter value="PemsUsProEntities" />
        </parameters>
    </defaultConnectionFactory>
    <providers>
    </providers>
</entityFramework>
这里的问题是父站点需要EF 5.0,子站点需要EF 6.0。我想知道我是否可以在我的孩子身上覆盖它,而不必触碰我父母网站上的任何东西

我在配置部分的child
web.config
中尝试了
,但它说

节或组名称“entityFramework”已定义。更新至 这可能只发生在定义它的配置级别


我使用的是IIS 7.5

您的意思是说这两个站点驻留在同一个解决方案中?不是解决方案。在IIS上,我从解决方案a部署了IIS上的站点,然后在该站点下添加了应用程序,该应用程序是从其他解决方案部署的。然后它变成了站点下的站点,所以父站点配置与子站点冲突。您看过“位置”设置了吗?这个问题在overflow中的另一个链接中得到了回答,该链接没有解释配置部分。我在配置部分试过了,但没有成功