c# - visual studio 2010和entity framework 5.0,我可以用吗?

标签 c# entity-framework

好吧,我真的想更新 Entity Framework 的4.1版本,所以在工具-->库包管理器-->包管理器我使用这个命令:

安装包 EntityFramework

然后更新开始了。我看到一条消息说版本 5 已安装。在我的项目文件夹中,我可以看到两个文件夹,一个带有 net4 库,另一个带有 net5 库。

但是,在我项目中的引用中,4.1被替换为4.4,而不是5.0版本,所以我想知道我是否可以使用5.0版本或只能使用4.4版本。如果我只能使用4.4版本,为什么要安装5.0版本?我知道已安装 5.0 版本,因为如果我尝试通过包管理器再次安装 Entity Framework ,我会收到以下消息:

“‘EntityFramework 5.0.0’已经安装。”

谢谢。

最佳答案

当您以 .NET 4.0 为目标时, Entity Framework 将引用 4.4

参见 this blog .

The 4.4 comes from the assembly version of EntityFramework.dll when you install EntityFramework 5.0 into a project that targets .NET Framework 4.0. This is merely a side effect of how the runtime loads and binds to assemblies, and in no way reflects the version of the product.

关于c# - visual studio 2010和entity framework 5.0,我可以用吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12921194/

相关文章:

asp.net - 将列添加到 AspNetUsers 表

silverlight - RIA 服务对比WCF 和共享代码

c# - Visual Studio 2015 和 IFormatProvider 中的字符串插值 (CA1305)

c# - 使用反射通过从 setter 调用的方法获取属性的属性

c# - 在 C# 中将网站动态翻译成阿拉伯语

c# - 调用方法并绘制

c# - 在多线程程序中使用 EF 的好建议?

database - 'system data' 应该在数据库中吗?

c# - 运行种子方法转换为值类型 <type> 失败,因为物化值为 null

c# - 文件上传导致模型验证失败