Upgrading a project to MVC 5

34,087

Solution 1

Visual Studio 2013 will automatically upgrade a project simply by allowing the Nuget Package Manager to run Updates.

Steps:

In Visual Studio 2013, open the project and right click on the project name to open the Properties window. Change the Target Framework to at least 4.5.

Then, on the project right click on the References item, and select Manage NuGet Packages. On the right side of the window select "Updates", and underneath select "All". This should begin a search for all packages needing to be updated. When the search completes an "Update All" button will appear which if clicked, will update all packages.

Note, my project had the UpgradeMvc3ToMvc4 package. It could not upgrade this so I uninstalled it first, but allowed the dll's to remain when asked.

Solution 2

See https://docs.microsoft.com/en-us/aspnet/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2 Microsoft info. It works for me ...

Share:
34,087
ncbl
Author by

ncbl

Updated on March 23, 2020

Comments

  • ncbl
    ncbl about 4 years

    I have been looking for a solution to upgrade a current MVC 4 app that i have to use the new MVC 5 binaries. I cannot find a solution anywhere.

    Anyone have any ideas?

  • Rosdi Kasim
    Rosdi Kasim over 9 years
    This answer is wrong. While it does update the packages, but project type and settings (razor version etc) are still MVC4. Please use the accepted answer above.
  • Simcha Khabinsky
    Simcha Khabinsky almost 9 years
    This answer is incomplete - just upgrading all the packages does not update the necessary config files.
  • jazzcat
    jazzcat over 7 years
    @RosdiKasim which "accepted answer" are you referring to?
  • Rosdi Kasim
    Rosdi Kasim over 7 years
    @jazzcat For some reason the answer has been deleted by the owner. Btw you should follow this guide: asp.net/mvc/overview/releases/…