EntityFramework.dll与System.Data.Entity.dll - 歧义 [英] EntityFramework.dll vs System.Data.Entity.dll -- ambiguity

查看:87
本文介绍了EntityFramework.dll与System.Data.Entity.dll - 歧义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道EntityFramework.dll和System.Data.Entity.dll有什么共同点,它们有什么不同?我的项目引用System.Data.Entity.dll(June CTP)来利用代码第一个模型,一切都正常。



现在我想使用Code First Migrations工具,它需要EntityFramework.dll,我也必须添加到我的项目。但是,当引用这两个库(EntityFramework.dll和System.Data.Entity.dll)时,我收到了很多编译器错误,认为在两个库中都定义了一些类。



当我删除EntityFramework.dll时,项目会再次编译,但是我无法使用迁移。当仅引用EntityFramework.dll时,我会收到错误的告诉我没有找到某些类(例如空间数据类型)。



在这种情况下该怎么办?谢谢你提前!

解决方案

System.Data.Entity.dll版本4.2.0.0(June CTP 2011)包含所有内容来自EFv4.0和EFv4.1 = ObjectContext API和DbContext API +新功能,但它可能是长时间的唯一版本,它将在同一程序集中组合这两个API。这个CTP已经死了。新的核心功能将被移动到.NET 4.5,并且DbContext API仍将作为单独的包含EntityFramework.dll的NuGet包发送。一切都被描述这里



代码迁移取决于EFV4.1 Update 1及其EntityFramework.dll。它们与June CTP不兼容,它直接在其安装说明或先决条件 =您不能在6月CTP中使用它们。


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!

解决方案

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.

这篇关于EntityFramework.dll与System.Data.Entity.dll - 歧义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆