Visual Studio 2010 MVC 2 Upgrade Wizard

Visual Studio 2010 MVC 2 Upgrade Wizard

  • Comments 3

Prior to the RTM release of Visual Studio 2010, the only way to upgrade an ASP.Net MVC 1 application to ASP.Net MVC 2 was to use Eilon Lipton’s tool. With the release of Visual Studio 2010 you will now be able to open your MVC 1 projects in Visual Studio 2010 and upgrade them to ASP.Net MVC 2 projects. Also, you can upgrade the target framework of the project to 4.0 or continue to target the 3.5 framework. When you first open an ASP.Net MVC 1 application in Visual Studio 2010, you will see the familiar Visual Studio Conversion Wizard.

image 

ASP.Net MVC specific code runs during this wizard and updates all System.Web.MVC references from version 1 to version 2. The wizard also updates the version numbers in the project’s Web.config and the Views folder’s Web.config. The project guid is also updated to the MVC 2 project guid so you will now be able to take advantage of Add Area while working on your application.

image

If you upgrade your project to 4.0, the project system will also upgrade System.Web.Routing and System.Web.Abstractions to 4.0 and modify the references in the project’s Web.config. At this point, you should be able to build and run your project.

image

What about class libraries and Visual Studio Test projects in my solution?

Unless you are using Visual Web Developer Express, the ASP.Net MVC upgrade wizard code does not upgrade your class libraries to the 4.0 framework, so make sure to upgrade them in the project properties if you choose to target the 4.0 framework when upgrading your ASP.Net MVC Application. Also you should check to make sure that class library references to System.Web.Abstractions and System.Web.Routing point to the version in the gac, now that these two assemblies are part of the 4.0 framework. Visual Studio Test projects do not support multi-targeting but for solutions with ASP.Net MVC applications they can be migrated to 4.0 along with your MVC Application.

  • If you are using C#, your VS Test project will upgrade to 4.0 regardless of whether you upgrade your ASP.Net MVC 2 Application and your project will build and run whether you target 3.5 or 4.0.
  • Visual Basic test projects will prompt for an upgrade to 4.0 so choose according to which framework you wish to target for your ASP.Net MVC app. In other words, don’t upgrade your app to 4.0 and not upgrade your test project or vice versa.

image

Hope this helps you get your ASP.Net MVC apps up and running in Dev10!

Joe Cartano | Visual Web Developer

Leave a Comment
  • Please add 5 and 7 and type the answer here:
  • Post
  • Can you give any advice on how to convert a .NET 3.5 MVC 1 application to .NET 4.0 MVC2 app in VWD 2010 when the project won't load because of the following error "The project type is not supported by this installation." Also, VWD 2010 does not list ASP.NET MVC application in the new project types.

  • Hi Matt,

    On your machine is VWD 2010 the rtm version? If you don't see an ASP.Net MVC 2 application template in the new project dialog it sounds like somehow the ASP.Net MVC 2 tooling component did not get installed on your machine. You can contact me at joecar@microsoft.com and we can work out what went wrong with your installation.

    Thanks,

    Joe Cartano | Visual Web Developer

  • I learned some knowledge and experience.You can visit our website ugg outlet store, you need to buy the goods acquisition. Walked passed, do not miss. We hope you find the items you need to buy, here are inexpensive goods.Hello, read the comments above, I learned something, thank you! To this end I recommend you a shoe, this shoe is very comfortable to wear and very durable I am sure you will love reading. www.uggs-boots-outlet.com

Page 1 of 1 (3 items)