Updating to Entity Framework v.Latest the Easy Way
Entity Framework is evolving rapidly which is why they are releasing via NuGet rather than being strapped to the .NET release cycle. (You can read more about the how's and why's of EF's release cycle here: http://blogs.msdn.com/b/diego/archive/2012/01/15/why-entity-framework-vnext-will-be-ef5-and-nothing-else.aspx ).
(The following is about keeping current with Entity Framework Code First and DbContext, not about upgrading the core API that is in .NET.)
It's recommended that you keep your apps that use EF (Code First/DbContext) up to date. The updates add functionality and fix some bugs, so this is a fairly safe prospect (granted there were a few problems for some very particular scenarios in the past but those have been corrected).
Thanks to the NuGet integration in Visual Studio it's really easy to update EF assemblies across a solution without having to update each project that might need it. (You'll need NuGet installed in VS which you can do via the Extension Manager.)
Right click the solution in Solution Explorer and click Manage NuGet Packages for Solution.
Select Updates. The dialog will show you any packages for which updates are available. My solution has 5 projects and I am using EF 4.1 in four of them. So the tool sees that I've got those installed and that there's a newer version available, so it presents that to me. Click Update.
Now I am presented with all of the projects that are using an out-of-date version of Entity Framework. By default, they are all checked to have the most current version installed. Click OK.
As NuGet updates the packages in your projects, it will show the progress for each package. Here I can see that my console app project has just been updated from 4.1 to 4.3.1.
Julia Lerman's Blog
- Julia Lerman's profile
- 18 followers

