zoukankan      html  css  js  c++  java
  • 新建MVC3 编译出现 System.Web.Mvc.ModelClientValidationRule

    我在vs2010 新建一个Mvc3项目,编译报一下错误:

    错误 1 'c:Program Files (x86)Microsoft ASP.NETASP.NET Web Pagesv2.0AssembliesSystem.Web.WebPages.dll' 和 'c:Program Files (x86)Microsoft ASP.NETASP.NET MVC 3AssembliesSystem.Web.Mvc.dll' 兩者中都有型別 'System.Web.Mvc.ModelClientValidationRule' D:MvcApplication1MvcApplication1ModelsAccountModels.cs 242 28 MvcApplication1

    可以如下修改,保持兼容性:

    (1)修改 Web.config。增加key为webPages:Version并且value为1.0.0.0的节点,即:

    <appSettings>
       
    <addkey="webpages:Version"value="1.0.0.0"/>
       
    <addkey="ClientValidationEnabled"value="true"/>
       
    <addkey="UnobtrusiveJavaScriptEnabled"value="true"/>
    </appSettings> (2)修改 ProjectName.csproj。(直接用记事本打开)
    搜索:
    <Reference Include="System.Web.WebPages"/> 
    <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"
    /> 
  • 相关阅读:
    MongoDB的基础连接
    Pygame的图像移动
    Pygame的KEYDOWN和KEYUP
    Pygame的程序开始
    Tkinter的MessageBox组件
    流程控制语句-if...else语句
    流程控制语句-if判断
    分享数组概念、创建、赋值、长度与使用
    js入门与实战课前准备和编辑工具介绍
    JavaScript进阶篇-JS基础语法
  • 原文地址:https://www.cnblogs.com/AaronYang/p/3156098.html
Copyright © 2011-2022 走看看