There's some confusion between EntityFramework.dll and System.Data.Entity.dll.

.net ef-code-first entity-framework


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!

12/6/2011 7:45:02 PM

Accepted Answer

System.Data.Entity.dll version "" (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.

10/26/2011 8:00:41 AM

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow