我的项目使用哪个版本的Entity Framework?

编程入门 行业动态 更新时间:2024-10-25 22:37:22
本文介绍了我的项目使用哪个版本的Entity Framework?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个使用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?

本文发布于:2023-11-04 17:44:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1558591.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本   项目   Framework   Entity

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!