zoukankan      html  css  js  c++  java
  • 同时安装vs2010和VS2012后IEnumerable<ModelClientValidationRule>编译错误

        今天安装了VS2012后,发现原来的一个MVC项目编译时发生错误,具体错误信息如下:

    错误    4    类型“System.Web.Mvc.ModelClientValidationRule”同时存在于“c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\System.Web.WebPages.dll”和“c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll”中    

    查阅一些资料后,解决方法如下:

    Step 1

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

    1   <appSettings>
    2     <add key="webpages:Version" value="1.0.0.0"/>
    3   </appSettings>


    Step 2

    关闭解决方案

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

    找到

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

    改成

    1     <Reference Include="System.Web.WebPages, Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL "/> 
    2     <Reference Include="System.Web.Helpers, Version=1.0.0.0,Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />

    保存,OK。现在再重新打开编译一下试试。

    参考:http://forums.asp.net/t/1723108.aspx/1

  • 相关阅读:
    javaWeb应用 ssm架构 三方外卖系统
    字节跳动2017秋招-前端工程师
    原码补码反码
    MVVM设计模式
    初始化 react 项目
    antd-mobile定制主题
    jeecg-boot 在线代码生成记
    jeecg-boot 开源代码 问题记录
    idea 导入maven 项目一点反应没有,无识别
    layui 搜索加动态添加列
  • 原文地址:https://www.cnblogs.com/ahwwmb/p/2700832.html
Copyright © 2011-2022 走看看