What version of Entity Framework is used by my project?

I have a project using Entity Framework, but I'm not sure which version of EF I am using. In accordance with the Version History Microsoft EF5 will install itself:

If you create a new model using the Entity Framework Designer in Visual Studio 2012, the EF5 NuGet package will be installed in your project, and the generated code will use EF5.

However, I did not create the EF part of the project, but got it from version control (TFS). Now I'm not sure how to determine if I have EF5.

If I right-click on the Links folder of the project and select Manage NuGet Packages, it will display EF5 using the Delete button, implying that I have EF5.

But the system.data.entity file in the Links folder has Runtime version v4.0.30319 and version 4.0.0.0 in the Property Explorer, which implies EF 4 (according to the "Define" version of the Entity Framework that I use? ).

I have this in my app.config :

 <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 

And this is in my 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> 

Can anyone clarify this?

+6
source share
5 answers

According to this answer in Entity Framework 5 is not installed correctly? , you need to look only at EntityFramework.dll , which in my case shows the Runtime Version v4.0.30319, but Version 5.0.0.0. (So, I have EF 5.)

+2
source

Perhaps your proyect is based on .NET 4.0, in which case you have an EF5 version without .NET 4.5 features:

EntityFramework 5 uses dll version 4.4.0.instead 5.0

+3
source

Go to the packages.config file of your project.

  <package id="EntityFramework" version="6.1.3" targetFramework="net45" /> 
+1
source

I have the same version number in System.Data.Entity. This comes from the .Net infrastructure, not to install the Entity Framework. You can see which parts of your application use it by right-clicking the link and select Find Module- specific Code . As a rule, not so much if the code does not access metadata, mainly states and the defn attribute are listed. The next version will bring it all to EntityFramework.dll - see EFv6

By the way, looking at the folder in the System.Data.Entity properties, v4.0.30319 is in .NETFramework \ v4.5

0
source

The easiest way to get this information is to install Microsoft ASP.NET MVC Diagnostics 5.2.3

It simply creates a web page for your project with all the relevant information. For example, you can simply find โ€œEntityโ€ on this page and immediately see the version information.

Here is an article showing the use of this diagnostic tool.

0
source

All Articles