[英]The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Whenever I try to compile my VS2015 application, I a long list of errors like:每当我尝试编译我的 VS2015 应用程序时,都会出现一长串错误,例如:
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:更新我忘了提到我已经尝试过:
What would cause this?什么会导致这种情况? How do I eliminate it?
我该如何消除它?
in my case it worked only after I run in the Package Manager Console following command在我的情况下,它仅在我在包管理器控制台中运行以下命令后才起作用
PM> Install-Package Microsoft.AspNet.Mvc
My environment was:我的环境是:
1) Visual Studio 2017
2) Freshly created Angular 4 app
3) MVC 6 as a back end
尝试下载并将 System.Web.Mvc.dll 复制到您的项目 bin 文件夹中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.