问题
I was working a bit ahead and planning for transition from EF 4.2 CTP to EF 5.0 and when "adding a code generation template" in VS11 + .NET 4.5 the DbContext template is no longer available. Any heads up on if one will be available and if not why (just curious)?
Update:
I see references to a DbContext template in the Enum tutorial, but yet I don't see the template in my VS11 project targeting .NET 4.5 with EF5.0 -pre installed. I see the other two V5.0 templates (EntityObject and Self-Tracking). Could it be a conflict with other installations, like in my case, Entity-Framework 4.2 CTP? I ran into template issues where VS couldn't decide what System.Data.Entity to use and defaulted to 4.2's when trying out EF 5.0.
Update 2:
Fresh install of Windows Server 8 Beta, with a fresh install of Visual Studio 11 Beta, still no EF5 DbContext code generation template. EF 4.2 and template extensions from VS 2010 are not installed, in fact neither is VS 2010. Just an fyi...
回答1:
I didn't check it myself, but according to this Entity Framework Releases and Versioning It will be provided.
Try to install EntityFramework 5 Beta 2 using install-package EntityFramework -pre and then install EF 5.x DbContext Generator for C#
Note that starting with the Entity Framework version 4.1 release, the Entity Framework is not part of.NET but is built on .NET. So I think that any related tools will be released separately on nuget or visualstudio gallery.
来源:https://stackoverflow.com/questions/9876619/entity-framework-5-0-beta-will-a-dbcontext-code-generation-template-be-provide