Resources:
ASP.NET MVC 3 Preview 1 – MVC-3-Preview-1-Release-Notes.doc
ASP.NET MVC Preview 3 Release – ScottGu
ASP.NET MVC 3 Preview 1 Released : Channel 9 Video and Hanselminutes Podcast 224, Oh My!
ASP.NET MVC 3 Preview 1 Released – Phil Haack
ASP.NET MVC 3 can be installed side by side with ASP.NET MVCÂ 2 on the same computer, which gives you flexibility in choosing when to upgrade an ASP.NET MVCÂ 2 application to ASP.NET MVCÂ 3.
The simplest way to upgrade is to create a new ASP.NET MVCÂ 3 project and copy all the views, controllers, code, and content files from the existing MVCÂ 2 project to the new project and then to update the assembly references in the new project to match the old project. If you have made changes to the Web.config file in the MVCÂ 2 project, you must also merge those changes with the Web.config file in the MVCÂ 3 project.
To manually upgrade an existing ASP.NET MVC 2 application to version 3, do the following:
- In both Web.config files in the MVCÂ 3 project, globally search and replace the MVC version. Find the following:
- In Solution Explorer, delete the reference to System.Web.Mvc (which points to the version 2 DLL). Then add a reference to System.Web.Mvc (v3.0.0.0).
- In Solution Explorer, right-click the project name and then select Unload Project. Then right-click again and select Edit ProjectName.csproj.
- Locate the ProjectTypeGuids element and replace {F85E285D-A4E0-4152-9332-AB1D724D3325} with {E53F8FEA-EAE0-44A6-8774-FFD645390401}.
- Save the changes and then right-click the project and select Reload Project.
- If the project references any third-party libraries that are compiled using ASP.NET MVCÂ 2, add the following highlighted bindingRedirect element to the Web.config file in the application root under the configuration section:
[sourcecode language="csharp"]
System.Web.Mvc, Version=2.0.0.0
[/sourcecode]
Replace it with the following
[sourcecode language="csharp"]
System.Web.Mvc, Version=3.0.0.0
[/sourcecode]
There are three changes in the root Web.config and four in the ViewsWeb.config file.
[sourcecode language="csharp"]
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc"
publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
[/sourcecode]
Pingback: Tweets that mention » Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 Rick Schott – devlpr.net -- Topsy.com
Pingback: » Upgrading an ASP.NET MVC 2 Project to ASP.NET MVC 3 Rick Schott … - asp
Thanks Rick. Pretty painless.
Pingback: ASP.NET MVC 3, IIS Express, VS2010 SP1 Beta & SQL CE 4 – They’ve all arrived!!! « ASP.NET, MVC & SQL Server Development
Thanks a lot.
It worked. Very easy steps.
Pingback: Why I upgraded to Entity Framework 4?
I found that in order for the System.Web.Mvc 3.0.0.0 assembly to be listed in the Add References dialog, I had to target .NET Framework 4.0 for my web project.
Thank you, this worked for me.