zoukankan      html  css  js  c++  java
  • 安装asp.net mvc4后mvc3项目编译报错

    安装asp.net mvc4之后,之前的mvc3项目编译时报这个错“The type System.Web.Mvc.ModelClientValidationRule exists in both c:Program FilesMicrosoft ASP.NETASP.NET MVC 3AssembliesSystem.Web.Mvc.dll and c:Program FilesMicroso...”

    重新安装mvc3也许可以解决这个问题,不过还会覆盖mvc4的配置,可以通过修改引用来解决:

    1.打开根目录下web.config文件添加一下配置项:

    <appsettings>

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

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

    <add key="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"/>

    3.重新加载项目,编译OK。

  • 相关阅读:
    6章-项目进度管理-day5
    常规正则表达式
    axios删除接口
    elk
    英语笔记
    升级打怪
    用computed实现watch的保持子组件与父组件值同步
    vertical-align不生效的问题
    css居右
    使用maven创建spring工程出现配置文件打不开/不存在的错误
  • 原文地址:https://www.cnblogs.com/xcsn/p/4209423.html
Copyright © 2011-2022 走看看