类型或名称空间名称'Mvc'在名称空间'System.Web'中不存在(您是否缺少程序集引用?) [英] The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

查看:68
本文介绍了类型或名称空间名称'Mvc'在名称空间'System.Web'中不存在(您是否缺少程序集引用?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试编译我的VS2015应用程序时,我都会列出很多错误,例如:

Whenever I try to compile my VS2015 application, I a long list of errors like:

The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

但是,一旦我双击该错误以查看文件,它就会打开文件,稍有延迟,然后清除所有错误.

However, as soon as I double click the error to view the file, it opens the file, has a slight delay, then clears ALL the errors.

如果继续尝试进行构建,则会得到相同的错误列表,并且该过程会重复进行.

If I proceed to try and build again, I get the same list of errors and the process repeats itself.

更新 我忘了提到我曾经尝试过:

UPDATE I forgot to mention that I have tried:

  1. 遵循其他几个SO问题中的建议-无济于事
  2. 确保将dll设置为复制到本地
  3. 删除和重新添加引用
  4. 从应用程序中删除dll并将其重新添加
  5. 清理并重建应用程序
  6. 重新启动应用程序和我的计算机

这是什么原因造成的?如何消除呢?

What would cause this? How do I eliminate it?

推荐答案

  • 重新启动Visual Studio
  • 删除程序集引用并重新添加
  • 进行清理并重新构建
  • 尝试从nuget软件包管理器安装Microsoft.AspNET.MVC
  • 这篇关于类型或名称空间名称'Mvc'在名称空间'System.Web'中不存在(您是否缺少程序集引用?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆