MVC3 Upgrade the Mvc4 method record. -Chess pity-Blog Park

Source: Internet
Author: User

<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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.