MVC3 Project compile error after installing ASP. Mvc4

Source: Internet
Author: User

After installing ASP. Mvc4, the previous MVC3 project compiles the Times this wrong "the type System.Web.Mvc.ModelClientValidationRule exists in both C:\Program files\ Microsoft asp.net\asp.net MVC 3\assemblies\system.web.mvc.dll and C:\Program files\microso ... "

Reinstalling MVC3 may solve this problem, but it also overrides the Mvc4 configuration, which can be resolved by modifying the reference:

1. Open the root directory under the Web. config file to add a configuration entry:

<appsettings>

<add key= "webpages:version" value= "1.0.0.0"/>

<add key= "clientvalidationenabled" value= "true"/>

<add key= "unobtrusivejavascriptenabled" value= "true"/>

</appsettings>

2. Uninstall the project and use the Edit tool to open the ProjectName. csproj. File, replacing the following configuration items:

<reference include= "System.Web.WebPages"/>

<reference include= "System.Web.Helpers"/>

Replace with:

<reference include= "System.Web.WebPages, version=1.0.0.0, Culture=neutral, Publickeytoken=31bf3856ad364e35, Processorarchitecture=msil "/>

<reference include= "System.Web.Helpers, version=1.0.0.0, Culture=neutral, Publickeytoken=31bf3856ad364e35, Processorarchitecture=msil "/>

3. Reload the project and compile OK.

MVC3 Project compile error after installing ASP. Mvc4

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.