Switch: ASP. NET mvc3 upgraded to ASP. NET mvc4

Source: Internet
Author: User

Because you want to change the project that was previously upgraded to mvc4 to mvc3ArticleI couldn't open it, And I reported a Connection Reset. I had to wait for a long time before a connection could be opened. Then I quickly turned around. The GUID string cannot be remembered.

So far, Asp. net MVC 4 has released the beta version, which will soon be released. net MVC 3 Project upgraded to ASP. net MVC 4 developers, this upgrade project is also a very important issue. The biggest concern is the fear of other problems brought about by the upgrade. We are very much looking forward to the new features of ASP. net mvc 4, but are worried about the huge risk of the upgrade.

In fact, upgrading ASP. net mvc 3 to 4 is not that complicated and can be done manually. Let's take a look at how to manually upgrade ASP. net mvc 3:

1. Install ASP. net mvc 4 and ASP. net mvc 4 beta release. You can download

Ii. Upgrade the configuration of ASP. net mvc:

1: replace

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

Configure the latest 4.0:
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: Upgrade ASP. NET to "2.0.0.0" in Web. config and add a new node:Preserveloginurl, The value is "true ":

<Deleetask>
<Add key = "webpages: version" value = "2.0.0.0"/>
<Add key = "preserveloginurl" value = "true"/>
<Deleetask>

3: In Solution Explorer, reference the latest Solution Explorer and deleteSystem. Web. MVC System. Web. MVC(V4.0.0.0 ).

Delete 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)

Add 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 Solution Explorer, uninstall the current project and editProjectname. Csproj.

FindProjecttypeguidsElement and replace {E53F8FEA-EAE0-44A6-8774-FFD645390401} with {E3E379DF-F4C6-4180-9B81-6769533ABE47 }.

Save the changes, close the (. csproj) file, and reload the project.

5: if any third-party component in the project references the old version of ASP.. Net MVC. add three bindingredirect elements to config



















the upgrade is complete.

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.