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

February 3, 2013 comment , ,

ASP.NET MVC: Auto upgrade MVC 3 to MVC 4 application

Yeah you read it right... Its NuGet package to upgrade existing ASP.NET MVC 3 application to ASP.NET MVC 4 application. From last month or two, I was planning to create NuGet package which automatically upgrade existing MVC 3 application to MVC 4 application but somehow I was keeping it at lower priority, but during last week I observed that many readers are redirected to Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4 from this stackoverflow question and I found that developer community are also looking for tool which automatically handle this upgrade. So I have created NuGet package and published it here https://nuget.org/packages/UpgradeMvc3ToMvc4 and whole exported package is uploaded here https://github.com/NandipMakwana/UpgradeMvc3ToMvc4

I have upgraded few MVC 3 application to MVC 4 application with this package and it worked fine for me. If solution is under source control then please make sure that all web.config are writable and checked out. Along with upgradtion I have also included MVC 4 FixedDisplayModes, Web Optimization Framework, DotNetOpenAuth packages for enabling oAuth login after upgrade. It will also add AuthConfig.cs & BundleConfig.cs in App_Start directory. To enable oAuth & Bundling, we need to add following line in Application_Start in global.asax.cs.

BundleConfig.RegisterBundles(BundleTable.Bundles);
AuthConfig.RegisterAuth();

Once we upgrade with this package, Visual Studio will ask to reload project as we are changing project type from MVC 3 to MVC 4.

How to test upgrade is success or not?

Yes... here is quick tip. Copy any view let say Index.cshtml and copy it and rename it to Index.mobile.cshtml. Now browse upgraded MVC 4 application with mobile simulator or override user agent in browser.

Hope It will be helpful and do let me know your feedback here in comment.

Project URL: https://github.com/NandipMakwana/UpgradeMvc3ToMvc4

NuGet URL: https://nuget.org/packages/UpgradeMvc3ToMvc4

One of the reader run in error Could not load file or assembly 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. solution to this error is answered on this Stack Overflow question

You can follow me on twitter for latest link and update on ASP.NET & MVC.

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