安装asp.net mvc4之后,之前的mvc3项目编译时报这个错“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...”

重新安装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。

安装asp.net mvc4后mvc3项目编译报错的更多相关文章

  1. 解决Myeclipse通过svn导入项目后,项目直接报错问题

    在使用Myeclipse2015通过SNV导入项目后,项目直接报错,如下图: 点开后报错详细信息如下: Multiple markers at this line - The type java.la ...

  2. 【vue】项目编译报错 Error: No PostCSS Config found in...

    问题描述: 项目在本地运行不报错,上传到 GitHub 之后,再 clone 到本地,执行: npm install 安装完成之后再执行: npm run dev 这时报错 Error: No Pos ...

  3. epel安装第三方扩展源后,运行yum报错的解决方案

    yum安装报错:Cannot retrieve metalink for repository: epel. Please verify its path and try again 解决方法: 一句 ...

  4. maven项目编译报错处理

    1.问题一: [ERROR] Failed to execute goal on project data-common: Could not resolve dependencies for pro ...

  5. prettier包升级后vue项目运行报错

    今天用vue-cli新建vue项目的时候,发现项目怎么都跑不起来. 最后通过与以前项目作比较,发现prettier这个依赖的版本从原来的1.12.0升级成了1.13.1.我也不太清楚为什么升级后项目跑 ...

  6. maven项目编译报错:Type Dynamic Web Module 3.0 requires Java 1.6 or newer.

    在maven的pom.xml文件中增加: <build>   <plugins>     <plugin>         <groupId>org.a ...

  7. 【vue】项目编译报错‘npm ERR! **@**dev: `webpack-dev-server --inline --progress --config ’’

    关于npm ERR! **@**dev: `webpack-dev-server --inline --progress --config‘ 原因:这是新版webpack存在的BUG,卸载现有的新版本 ...

  8. 已解决: idea创建并部署SpringMVC项目时 报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    用IDEA创建并运行SpringMVC项目时,最初发现没有Servlet包,这个问题已在上篇解决,然而当我们尝试去运行此时的SpringMVC项目时,发现仍然有错误.ClassNotFoundExce ...

  9. 项目启动报错怎么办?看看你Spring自动注入用对了嘛?@Autowired XxxService注入问题解决

    问题 在Controller层使用 @Autowired注入Service时,提示Bean中没有Service 在Service接口中使用 @Component注入后,启动项目问题提示: The we ...

随机推荐

  1. K8S 创建rc 时 不适用本地镜像的解决办法

    spec: containers: - name: nginx image: image: reg.docker.lc/share/nginx:latest imagePullPolicy: IfNo ...

  2. CentOS下部署Jupyter

    目录 安装 配置 准备密码密文 生成配置文件 修改配置 启动 参考:在服务器搭建Jupyter notebook 安装 为了环境比较轻,使用pip安装,非Anaconda: # 创建Python虚拟环 ...

  3. 选择提供器 - 选择监听器(selection provider-selection listener)模式

             

  4. 【转】如何向XML内插入一个字符串片段

    转自:http://bbs.csdn.net/topics/190051229   5楼 string filepath = Server.MapPath("你的xml文件"); ...

  5. 【Revit API】获取链接模型中构件

    话不多说,直接代码 var doc = commandData.Application.ActiveUIDocument.Document; FilteredElementCollector link ...

  6. AtCoder Grand Contest 007

    AtCoder Grand Contest 007 A - Shik and Stone 翻译 见洛谷 题解 傻逼玩意 #include<cstdio> int n,m,tot;char ...

  7. POJ 3660 Cow Contest / HUST 1037 Cow Contest / HRBUST 1018 Cow Contest(图论,传递闭包)

    POJ 3660 Cow Contest / HUST 1037 Cow Contest / HRBUST 1018 Cow Contest(图论,传递闭包) Description N (1 ≤ N ...

  8. 哈夫曼树;二叉树;二叉排序树(BST)

    优先队列:priority_queue<Type, Container, Functional>Type 为数据类型, Container 为保存数据的容器,Functional 为元素比 ...

  9. CentOS 7 系统root用户忘记密码的重置方法

    在一台服务器我们忘记了root的账号或者root账号错误怎么办,我们只有进入到内核里面去修改,具体的操作如下: 1.进入内核 在开机的时候出现下图的界面时 按e键进入内核入下图 2.进入单用户模式 在 ...

  10. 位运算符和unity Layers

    按位运算符:与(&).非(~).或(|).异或(^).<<(左移).>>(右移).位运算符主要用来对二进制位进行操作. 逻辑运算符:&&.||.!.逻辑 ...