When Entity Framework 5 (EF5) is not Entity Framework 5 (EF5)

Installing EntityFramework 5 to my project.

image

EF5 has been successfully installed.

But I installed it to a project targeting .NET 4, not .NET 4.5. Check out the version of Entity Framework that got installed. It’s not 5.0.0.0. It’s 4.4.0.0.

SNAGHTML16ea8760

So what’s with that version number? Here is the folder created when I installed the EF5 package. (EntityFramework.5.0.0.-rc).

There are two folders in the lib folder – net40 and net45. Inside net40 there’s an EntityFramework.dll that has the product version name “5.0.0-4c.net40” and its File version is 4.4.20502.0.

SNAGHTML16f06907

In the net45 folder is the EntityFramework.dll file that is version 5.0.0.0.

The 4.4 version understands what’s in System.Data.Entity.dll in .NET 4.

The 5.0 version understands what’s in System.Data.Entity.dll in .NET 4.5. .NET 4.5 is where enum support lives, where System.ComponentModel.DataAnnotations.Schema lives, where System.Data.Spatial lives, etc.

We have two versions of EntityFramework coming via a single NuGet so that YOU don’t have to worry about downloading the correct version to align with the version of .NET that your project is targeting.

This makes a lot of sense, but there are a lot of people who ask me “I just downloaded EF5 but where are the enums”.

Hope this clears things up for some of you. Smile

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

5 thoughts on “When Entity Framework 5 (EF5) is not Entity Framework 5 (EF5)

  1. Awesome… I was wondering how they were supporting both .Net 4 and .Net 5.

    But, I would prefer separate packages. Didn’t they go to semantic version numbers for a reason?

  2. Does Entity Framework 5 Code First model supports Stored Procedures with Complex Data Type Mapping? I am stuck at crucial step in my project and will be disappointed if just for few Sps I have to discard EF Code First and do lots of rework…. Please advise.

  3. code first does not support MAPPING to stored procs but you can call stored procs from the dbcontext. You can find lots of info about that via google.

    Code FIrst does support complex data types.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.