We move some projects from VS2010 to VS2012 but still using .NET 4.0 and not .NET 4.5
When I add an new EDMX, VS2012 use EF 5.0 but I’d like continue to use the version 4.x it’s the first point.
Second point the version 5.0, inherit from DbContext and not ObjectContext like version 4.x. With the version 5.0 I don’t see any way to pass the connection string as parameter.
How can I use version 4.x in VS2012, with the same EDMX designer behavior ?
Thanks,
As mentioned in the comments, you’re really getting EF 4.4, not EF 5.0. However, confusingly, EF 4.4 in contained in the NuGet EntityFramework 5.0 package.
For your other question, you can open the EDMX in the designer, restore “Code generation strategy” from “None” to “Default”, then in the solution explorer, remove the
.ttfiles. Now you’ll have yourObjectContextagain, and if you wish, you can remove the EntityFramework package from your project.I’m not sure if there’s any way to change this default behaviour of adding the NuGet package.