@Blog.Author(Nandip Makwana) .LearningExperience(ASP.NET, ASP.NET MVC, IIS, jQuery & Technology Surrounding it...)

December 13, 2011 comment ,

Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4

Updated on 03-Feb-2013
Check out this NuGet package for auto update MVC 3 to MVC 4 application and read this post for more info ASP.NET MVC: Auto upgrade MVC 3 to MVC 4 application

This post is part of ASP .NET MVC 4 Article Series.

To upgrade and existing ASP.NET MVC 3 Project to ASP.NET MVC 4, one need to take care of following points. Complete guideline on upgrading from MVC 3 to MVC 4 is available in MVC 4 Release Notes.

  • In all web.config, including one in root folder and Views folder, change assembly version to for System.Web.Mvc and to for System.Web.WebPages, System.Web.Helpers, System.Web.WebPages.Razor.
  • Change appSettings value for key "webPages:Version" to "". Apart from that also add new appSettings key named "PreserveLoginUrl" with "true" as a value.
  • Now remove all reference to MVC 3.0 assembly and Webpages 1.0 assembly. And add a reference to MVC 4.0 assembly and Webpages 2.0 assembly.
  • If you are using any third party assembly built with previous versions of MVC then do not forget to configure bindingredirect in root web.config as mentioned here.
  • Finally one more step is to change project type to MVC 4 from MVC 3. For that unload project by right clicking in solution explorer and select edit ProjectName.csproj file. Now Locate the ProjectTypeGuids element and replace {E53F8FEA-EAE0-44A6-8774-FFD645390401} with {E3E379DF-F4C6-4180-9B81-6769533ABE47}. Now save changes and re load the project.

Complete step by step information is given here in MVC 4 Release Notes.

comments powered by Disqus

Featured Content

Resources & Tools

About Nandip Makwana

Nandip Makwana is passionate about digital world and web. He completed his Masters in Computer Application in June 2011. Currently he is working as a Software Engineer. He has shown great promise and command over ASP.NET and technologies surrounding it during his academic years and professorial life...continue reading