<title>MVC3 Upgrade the Mvc4 method record. -Chess pity-Blog Park</title>
Manually upgrade the ASP. NET MVC 3 project:
I. Installing ASP. NET MVC 4
Two. Upgrade the ASP. NET MVC version configuration information:
1: Replace in Project Web. config
SYSTEM.WEB.MVC, version=3.0.0.0
System.Web.WebPages, version=1.0.0.0
System.Web.Helpers, version=1.0.0.0
System.Web.WebPages.Razor, version=1.0.0.0
For the latest 4.0 configurations:
SYSTEM.WEB.MVC, version=4.0.0.0
System.Web.WebPages, version=2.0.0.0
System.Web.Helpers, version=2.0.0.0,
System.Web.WebPages.Razor, version=2.0.0.0,
2: In Web. config, upgrade the ASP. NET configuration to version: "2.0.0.0" and add a new node:preserveloginurl with the value "true":
<appSettings>
<add key= "webpages:version" value= "2.0.0.0"/>
<add key= "Preserveloginurl" value= "true"/>
<appSettings>
3: In Solution Explorer Solution Explorer, refer to the latest Solution Explorer, remove System.Web.Mvc System.Web.Mvc (v4.0.0.0).
To delete a reference:
- SYSTEM.WEB.MVC (v3.0.0.0)
- System.Web.WebPages (v1.0.0.0)
- System.Web.Razor (v1.0.0.0)
- System.Web.WebPages.Deployment (v1.0.0.0)
- System.Web.WebPages.Razor (v1.0.0.0)
To add a reference:
- SYSTEM.WEB.MVC (v4.0.0.0)
- System.Web.WebPages (v2.0.0.0)
- System.Web.Razor (v2.0.0.0)
- System.Web.WebPages.Deployment (v2.0.0.0)
- System.Web.WebPages.Razor (v2.0.0.0)
4:
In the Solution Explorer Solution Explorer, uninstall the current project, edit ProjectName. csproj.
Locate the projecttypeguids element and replace {e53f8fea-eae0-44a6-8774-ffd645390401} with {e3e379df-f4c6-4180-9b81-6769533abe47} .
Save the changes, close the (. csproj) file, and then reload the project.
5: If a third-party component in the project references an older version of ASP. Three bindingredirect elements can be added to the Web. config
<configuration>
<!--... elements deleted for clarity ...-->
<runtime>
<assemblybindingxmlns= "Urn:schemas-microsoft-com:asm.v1" >
<dependentAssembly>
<assemblyidentity name= "System.Web.Helpers" publickeytoken= "31bf3856ad364e35"/>
<bindingredirectold version= "1.0.0.0" newversion= "2.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyidentity name= "SYSTEM.WEB.MVC" publickeytoken= "31bf3856ad364e35"/>
<bindingredirectold version= "1.0.0.0-3.0.0.0" newversion= "4.0.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyidentity name= "System.Web.WebPages" publickeytoken= "31bf3856ad364e35"/>
<bindingredirectold version= "1.0.0.0" newversion= "2.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
so the upgrade is over.
From for notes (Wiz)
MVC3 Upgrade the Mvc4 method record. -Chess pity-Blog Park