Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EntityFramework.dll vs System.Data.Entity.dll -- ambiguity

I wonder what EntityFramework.dll and System.Data.Entity.dll have in common and what they have different? My project references System.Data.Entity.dll (June CTP) to leverage code first model and everything works fine.

Now I wish to use Code First Migrations tool, and it requires EntityFramework.dll that I also have to add to my project. However, when both libraries (EntityFramework.dll and System.Data.Entity.dll) are referenced, I get a lot of compiler errors arguing that some classed are defined in both libraries.

When I remove EntityFramework.dll, the project does compile again but I cannot use Migrations. When only EntityFramework.dll is referenced, I get complier errors telling me that some classes are not found (e.g. Spatial datatype).

What should I do in this situation? Thank you in advance!

like image 443
Alex Avrutin Avatar asked Oct 25 '11 21:10

Alex Avrutin


1 Answers

System.Data.Entity.dll version "4.2.0.0" (June CTP 2011) contains everything from EFv4.0 and EFv4.1 = both ObjectContext API and DbContext API + new features but it is probably the only version for a long time which will combine these two APIs in the same assembly. This CTP is dead. The new core features will be moved to .NET 4.5 and DbContext API will be still shipped as separate NuGet package containing EntityFramework.dll. Everything is described here.

Code migrations are dependent on EFv4.1 Update 1 and its EntityFramework.dll. They are not compatible with June CTP and it is directly described in their installation notes or prerequisites = you cannot use them with June CTP.

like image 55
Ladislav Mrnka Avatar answered Oct 19 '22 12:10

Ladislav Mrnka