Tuesday, April 15, 2014

How to manually update ASP.NET MVC 3 project to ASP.NET MVC 4?

Tried  nugget first, failed. If a simple project, should try this first.
https://www.nuget.org/packages/UpgradeMvc3ToMvc4

Then follow instruction from Microsoft to upgrade manually:
http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806

In addition to reference above:
1. Change web.config file in view folder  as well
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />

<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />

<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

2. Add reference to System.Web.Optimization
By run nuget package: Install-Package Microsoft.AspNet.Web.Optimization

No comments:

Post a Comment