[英]Upgrading solution from MVC 3.x to MVC 5.2.3: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web'
I have a solution that was originals built using VS 2010 and MVC 3.something. 我有一个解决方案,它是使用VS 2010和MVC 3.something构建的。 I am now using VS 2015 and MVC 5.2.3. 我现在正在使用VS 2015和MVC 5.2.3。 I deleted the old reference to MVC3 and changed it to the 5.2.3 dll. 我删除了对MVC3的旧引用,并将其更改为5.2.3 dll。 Now, whenever I try to build the solution, I receive multiple instances of this error: 现在,每当我尝试构建解决方案时,都会收到此错误的多个实例:
Error CS0234 The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
The error happens in each file (class) when I try to use System.Web.MVC: 当我尝试使用System.Web.MVC时,每个文件(类)中都会发生错误:
using System.Web.Mvc;
The reference DOES exist. 参考确实存在。 The odd thing is, if I remove this line in a given file, and replace it with the exact same thing, the error for that file will temporarily vanish, but will then come back at some seemingly random point in the future when I build again. 奇怪的是,如果我删除给定文件中的这一行,并用完全相同的东西替换它,则该文件的错误将暂时消失,但是在以后再次构建时,它将在某个看似随机的位置返回。
Based on some other threads of a similar nature, here's a couple things I have tried: 基于其他类似性质的线程,这是我尝试过的几件事:
Any other suggestions? 还有其他建议吗?
Is there more than one project in the solution? 解决方案中是否有多个项目? It's possible that one of the other projects is referencing an older version of MVC. 其他项目之一可能引用的是旧版本的MVC。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.