同时安装vs2010和VS2012后IEnumerable<ModelClientValidationRule>编译错误

错误    4    类型“System.Web.Mvc.ModelClientValidationRule”同时存在于“c:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv2.0
AssembliesSystem.Web.WebPages.dll”和“c:Program Files (x86)Microsoft ASP.NETASP.NET MVC 3AssembliesSystem.Web.Mvc.dll”中
查阅一些资料后,解决方法如下:

Step 1

修改Web.config,在 <appSettings>新增<add key="webpages:Version" value="1.0.0.0"/>
<appSettings>       
 <add key="webpages:Version" value="1.0.0.0"/>    
</appSettings> 
Step 2

关闭解决方案

用记事本打开 项目名称.csproj

找到

1 <Reference Include="System.Web.WebPages"/>   
2 <Reference Include="System.Web.Helpers" />
改成

<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" />
保存,OK。现在再重新打开编译一下试试。
原文地址:https://www.cnblogs.com/chenyongblog/p/3334268.html