Updating existing nugget packages is very important because some are incompatible with the new one, before we start migrating process, its better to keep an existing copy.
Change the framework to 4.5.1. Change the target framework to 4.5 at least by right clicking the projects.
Packages have to be updated at the solution level. It will update the packages in all the projects in the solution. To do this, right click the solution and select 'Manage Nugget Packages for solution' option as shown below.
From the install packages select the Microsoft.AspNet.Web.Helpers.Mvc packages and uninstall it, because it is renamed in the new version. To uninstall, click the Manage button and uncheck the web project and click ok.
Then go to the update packages and update some packages such as Microsoft.ASP.NET MVC, Entity Framework and Web API version 2. If you update top level packages, it will update other packages also. Now you can see the changes in packages.config file such as MVC 4 to MVC 5, Razor version change from 2 to 3 and also Webpage version from 2 to 3.
Change the version in our config file as well like below. These are the changes in the top level config file.
Then also you need to do some changes in views config file.
Install one more package. Go to manage nugget manager option >> select online table >> search for Microsoft.Aspnet.Webhelpers and install the package.
Unload the webproject and right click and select edit proj option and the remove the guide starting with E3 because we no need this guide in our new project.