I want to convert MVC2 web site to MVC4. I know there are tools to help with conversion from MV2 to MVC3 but I cannot find any tools or steps needed to convert from MVC2 to MVC4. Please point me to some article/blog which can provide me some more information to help with this process.
-
2Remove reference to MVC2 dll, add reference to MVC4 dll. :DRichard Dalton– Richard Dalton2012-08-24 10:01:48 +00:00Commented Aug 24, 2012 at 10:01
-
2Coming from MVC2, he's going to have issues with the view engine changes.Garrett Fogerlie– Garrett Fogerlie2012-08-24 10:08:23 +00:00Commented Aug 24, 2012 at 10:08
4 Answers
Looks like there is now a solution posted to a similar question that indicates that there exist two packages that can migrate from MVC 2 to MVC 3 and then from MVC 3 to MVC 4.
Here is what you'll need based on my experience doing the same upgrade recently:
- Ensure that you have upgraded your solution from VS2008 to VS2010
- ASP.NET MVC 3 Application Upgrader - A Standalone package for upgrading MVC2 -> MVC3
- UpgradeMvc3ToMvc4 - A nuget package for upgrading from MVC3 -> MVC4
Having used both of these recently I can vouch for them in that they worked very well for me.
2 Comments
Unfortunately there isn't a direct path from MVC 2 to MVC 4. The intermediate step to MVC 3 needs to be done.
Comments
There's a section dedicated for this in the release notes.
1 Comment
Personally, I find that conversions often have small glitches and issues. I prefer to just take the direct route and create a new MVC project, then move all the controllers, views, content, etc.. to the new project. Make sure to add in any packages you may be using (but I doubt you're using NuGet in an MVC2 app), and configure the project settings to match the original.
You can do this in about 5 minutes for a medium sized project, and maybe 10-15 in a large one, whereas converting projects can take a long time to sort out the various issues.
This doesn't take into account any breaking changes between MVC2 and 3, but thankfully those are pretty minimal and most people never have any. You would have the same issue with any project upgrade utility.