Tuesday, July 27, 2010

Upgrading to ASP.NET MVC 3 Preview 1

July 27, 2010 Posted by Jason Irwin , , No comments

Earlier today Scott Gu announced the availability of ASP.NET MVC 3 Preview 1. This release  includes the beginnings of the Razor view engine as well as a bevy of additional features. The following are some notable links with more details:

Scott Gu

Scott Hanselman

Phil Haack

Maarten Balliauw

Anyhow, I played with the demo and got to wondering how to update an existing ASP.NET MVC 2 project to use the new preview version (obviously I wouldn’t switch production code any time soon…)

It was simply a matter of editing my existing ASP.NET MVC 2 (C#) project file and making the following updates:

ProjectTypeGuids

Replace

{F85E285D-A4E0-4152-9332-AB1D724D3325}

With

{E53F8FEA-EAE0-44A6-8774-FFD645390401}

and

References

Replace

<Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />

with

<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />

Reloading my project I can confirm that everything builds nicely and I know have the additional option of creating a razor view as in the blow screenshot:

image

Simple stuff!

[Edit]

Looks like I missed a step. I also had to make a minor modification to my Web.Config file replacing:

<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" PublicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>


 



with



 <dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>

0 comments: