我有一个使用Entity Framework的项目,但是我不确定我正在使用哪个版本的EF. 根据 Microsoft版本历史记录 EF5会自行安装:
I have a project using Entity Framework, but I am not sure which version of EF I am using. According to the Microsoft version history EF5 will install itself:
如果您使用Visual Studio 2012中的Entity Framework Designer创建新模型,则EF5 NuGet软件包将安装到您的项目中,并且生成的代码将使用EF5.
If you create a new model using the Entity Framework Designer in Visual Studio 2012, the EF5 NuGet package will be installed to your project and the generated code will make use of EF5.
但是,我没有创建项目的EF部分,而是从版本控制(TFS)中获得了它.现在,我不确定如何确定我是否拥有EF5.
However I did not create the EF-part of the project, but got it from version control (TFS). Now I am not sure how to determine if I have EF5.
如果我右键单击该项目的References文件夹,然后选择Manage NuGet Packages,它将显示EF5,并带有一个卸载按钮,表示我有EF5.
If I right-click on the References folder of the project and select Manage NuGet Packages, it show EF5 with an Uninstall-button, implying I have EF5.
但是References文件夹中的system.data.entity在属性"资源管理器中具有运行时版本v4.0.30319和版本4.0.0.0,这意味着EF 4(根据确定我正在使用的Entity Framework版本?).
But the system.data.entity in the References folder has a Runtime Version v4.0.30319 and Version 4.0.0.0 in the Properties explorer, which would imply EF 4 (according to 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>有人可以澄清吗?
推荐答案根据此答案对实体框架5安装不正确?,人们应该只看EntityFramework.dll,在我案例显示运行时版本 v4.0.30319,但版本 5.0.0.0. (所以我确实有EF 5.)
According to this answer to Entity Framework 5 not installing correctly?, one should only look at EntityFramework.dll, which in my case shows Runtime version v4.0.30319 but Version 5.0.0.0. (So I do have EF 5.)
更多推荐
我的项目使用哪个版本的Entity Framework?
发布评论