我有一个项目使用实体框架,但我不知道我使用的EF版本。 按照Microsoft version history EF5将安装自己:我的项目使用哪个版本的实体框架?
,如果您使用的Visual Studio 2012的Entity Framework设计一种新的模式,EF5 NuGet包将被安装到您的项目,生成的代码会利用EF5。
但是我没有创建项目的EF部分,而是从版本控制(TFS)中获得它。现在我不知道如何确定我是否有EF5。
如果我右键单击项目的References文件夹并选择Manage NuGet Packages,它会显示带有卸载按钮的EF5,这意味着我有EF5。
但是,References文件夹中的system.data.entity在Properties浏览器中具有运行时版本v4.0.30319和版本4.0.0.0,这意味着EF 4(根据Determine version of Entity Framework I am using?)。
我有这在我的app.config
:
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
这在我web.config
:
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<!--...-->
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<!--...-->
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
任何人能澄清这一点?
好点,我没有想到。我检查了我的项目,但他们似乎都是.NET 4.5。 – 2013-04-05 13:03:15