Installing EntityFramework 5 to my project.
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 220.127.116.11. It’s 18.104.22.168.
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.
In the net45 folder is the EntityFramework.dll file that is version 22.214.171.124.
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.
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)”
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?
what thats now?
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.
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.
Thank you! This was causing problems with me. I tried updating EF before changing the target framework and had 126.96.36.199.