How to convert ASP. net mvc 1.0 to ASP. net mvc 2.0

Source: Internet
Author: User
Tags microsoft website

People who have installed vs2010 are probably having a headache. Those mvc1.0 projects cannot be opened in mvc2.0. After all, most examples on the Internet are 1.0.

Conversion Method 1:

Recommended on the official Microsoft website.

A. Back up the project files you need to convert.

B. Open the project file to be converted using notepad:. vbproj or csproj, find the projecttypeguid node, replace {603c0e0b-db56-11dc-be95-000d561079b0} with {F85E285D-A4E0-4152-9332-AB1D724D3325 }. Save the file.

C. Open the project's web. config file, find 'System. Web. MVC, version = 1.0.0.0 ', and replace them with 'System. Web. MVC, version = 2.0.0.0 '. Save your configuration file.

D. use Visual Studio to open the project and find System in 'quot. web. MVC, delete it; think it is version 1.0. After we delete it, we will delete the system of the new version 2.0. web. add MVC to reference.

5. Open the Web. config file and add the following content in the configuration Node Section (you can also leave it empty. I have tried it)

 

Code

  <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc"

publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0"
newVersion="2.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

 

 

Then compile it and you will be OK.

 

The second method is to use a tool for automatic conversion:

 

You can download this tool: MvcAppConverter-MVC2RTM.zip (255 KB) here ).

 

Related Article

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.