Are there technical reasons EF 5 isn't fully supported on .NET4.0?

前端 未结 1 679
遥遥无期
遥遥无期 2021-01-04 18:29

I wanted to upgrade my app to EF 5 to take advantage of features like support for enum spatial etc. However, I was not able to upgrade unless I move to .Net 4.5.

I w

相关标签:
1条回答
  • 2021-01-04 18:57

    My understanding is that EF >= 4.1 (including EF 5) consists of

    • the EF "core libraries" like (System.Data.Entity.dll) which are part of the .NET Framework
    • the additional package/assembly you can download via Nuget which contains the DbContext API and Code-First development

    There were plans and an attempt in summer 2011 (the Entity Framework June 2011 CTP) to release the enum, spatial support and other new features (except Code-First Migrations) as an update of the core librares before .NET 4.5 is released. But the EF team has decided that such out-of-band updates are possible for the NuGet package (that's why EF 4.3 already has the Migrations feature that didn't require to touch the core libraries), but for the core libraries they are too difficult and can't be done before .NET 4.5 release:

    There are two logical parts to the Entity Framework, the core components that ship inside the .NET Framework and Visual Studio and the ‘out of band’ components that we can update on a much more frequent schedule. We are currently looking at how we can update the core components on a more frequent cadence as well. The ‘EF June 2011 CTP’ was our first attempt at shipping the core components more frequently and it’s become clear we’re just not technically ready to do this yet.

    Core components include:

    • Core EF Runtime (System.Data.Entity.dll & System.Web.Entity.dll)
    • EF Designer

    Out of band components include: (We will likely ship more out of band components in the future)

    • The DbContext API & Code First (EntityFramework.dll)
    • T4 Templates for using DbContext API with Model First & Database First
    • EF Power Tools
    • Code First Migrations

    (Quote from here.)

    That means that enum support for EF will be part of the .NET 4.5 core libraries and not of the downloadable EF 5 NuGet package. Hence the new EF features like enum and spatial support are not available together with .NET 4.0.

    More about the history and reason of separating "EF Core libraries" from "EF NuGet package" is here: http://blogs.msdn.com/b/adonet/archive/2011/10/18/how-we-talk-about-ef-and-its-future-versions.aspx

    0 讨论(0)
提交回复
热议问题