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