【发布时间】:2014-01-21 08:25:37
【问题描述】:
我收到此错误:
Config Error There is a duplicate 'entityFramework' section defined
Config File \\?\D:\koopaproject\koopaproject\web.config
9: <!--For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468-->
10: <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />11: </configSections>
在我的 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=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<connectionStrings>
<add name="koopaco.com_koopaContext" connectionString="Data Source=localhost;Initial Catalog=koopaco.com_koopa;Persist Security Info=True;User ID=koopaco.com_zohre;Password=136613;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
</connectionStrings>
我安装了:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
但我仍然收到此错误。
【问题讨论】:
-
您是否检查了父文件夹或 machine.config 中的 web.configs 未指定实体框架部分?
-
什么意思?它是父文件夹中的网络配置。我做了上面所说的所有事情。
-
根目录下的配置文件呢? %systemroot%\Microsoft.NET\Framework\v4.0.30319\Config\machine.config %systemroot%\Microsoft.NET\Framework\v4.0.30319\Config\web.config
-
我检查了 web.config 并在 machine.config 中添加了实体框架部分和程序集,但它没有改变。
-
可能与:stackoverflow.com/questions/19324333/… 相关(目前在“相关”列表中排名第 6)。
标签: entity-framework