简体   繁体   English

什么版本的EntityFramework的带外组件应该与.NET 4一起使用?

[英]What version of EntityFramework's out of band components should be used with .NET 4?

For deployment reasons, my development team is currently stuck with .NET 4. 出于部署原因,我的开发团队目前仍然使用.NET 4。

However I would like to use the out-of-band EntityFramework.dll library (in order to use the DbContext API), but I have not been able to find any information regarding whether EntityFramework.dll v5 only targets .NET 4.5 or if it can work (albeit with reduced performance and features) on .NET 4.0. 但是,我想使用带外EntityFramework.dll库(为了使用DbContext API),但我无法找到有关EntityFramework.dll v5是否仅针对.NET 4.5或是否在.NET 4.0上可以工作(虽然性能和功能都有所降低)。

In a nutshell: Can I use EntityFramework.dll 5 with .NET 4.0? 简而言之:我可以在.NET 4.0中使用EntityFramework.dll 5吗? Or should I use EntityFramework.dll 4.3? 或者我应该使用EntityFramework.dll 4.3?

The NuGet EntityFramework 5 package contains both Entity Framework 5.0 and Entity Framework 4.4 DLLs. NuGet EntityFramework 5包包含Entity Framework 5.0和Entity Framework 4.4 DLL。 If you include it in a .NET 4 project, you'll get the 4.4 version. 如果将它包含在.NET 4项目中,您将获得4.4版本。 If you include it in a .NET 4.5 project, you'll get the 5.0 version. 如果将它包含在.NET 4.5项目中,您将获得5.0版本。 As you suspected, 4.4 lacks some features that did make it into 5.0. 正如您所怀疑的那样,4.4缺少一些确实使其成为5.0的功能。 You cannot use the 5.0 version in a .NET 4 project, but the 4.4 version will work just fine. 您不能在.NET 4项目中使用5.0版本,但4.4版本可以正常工作。

实体框架5(nuget包)适用于.NET 4.有一些新功能(空间类型,自动查询编译)需要.NET 4.5,但你可以完成90%的EF开发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM