我正在编写一个小型测试项目,以便首先了解 EF 代码。不幸的是,当我尝试编译时,出现以下错误:
Assembly 'Backend, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses
'EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
which has a higher version than referenced assembly 'EntityFramework, Version=4.1.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' c:\Users\Kevin\Documents\Visual
Studio 2010\Projects\CFTest\Backend\bin\Debug\Backend.dll CFTest
出于某种原因,存在版本冲突,但我不知道如何解决它。
编辑:我的 App.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<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=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=.\SQLEXPRESS; Integrated Security=True; MultipleActiveResultSets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</configuration>