【发布时间】:2013-04-04 16:29:27
【问题描述】:
我有一个使用实体框架的项目,但我不确定我使用的是哪个版本的 EF。 根据Microsoft version history EF5 会自行安装:
如果您使用 Visual Studio 2012 中的实体框架设计器创建新模型,EF5 NuGet 包将安装到您的项目中,并且生成的代码将使用 EF5。
但是我没有创建项目的 EF 部分,而是从版本控制 (TFS) 中获得的。现在我不确定如何确定我是否有 EF5。
如果我右键单击项目的 References 文件夹并选择管理 NuGet 包,它会显示带有卸载按钮的 EF5,这意味着我有 EF5。
但是 References 文件夹中的 system.data.entity 在 Properties explorer 中有一个 Runtime Version v4.0.30319 和 Version 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>
谁能澄清一下?
【问题讨论】:
标签: visual-studio entity-framework version entity-framework-5