问题描述
我正在Visual Studio 2015(最初在VS 2013中创建)中从事MVC项目
I am working on a MVC project in Visual Studio 2015 (originally created in VS 2013)
这一切都正确构建,但是在编码时,视图显示了很多错误.
It all builds correctly, but while coding, the views show alot of errors.
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
string quoteType = "Fee Estimate";
if (Model.Quote.QuoteType == "QuoteType")
{
}
}
在我其中一个视图顶部的代码中,Viewbag,Layout&所有带下划线的模型均显示错误.
In this code that is on the top of one of my views, the Viewbag, Layout & Model is all underlined showing an error.
错误是:
错误CS0234类型或名称空间名称'Mvc'在 命名空间"Microsoft.AspNet"(您是否缺少程序集 参考?)Quilgroup C:... \ Index.cshtml 1
Error CS0234 The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?) Quilgroup C:...\Index.cshtml 1
我认为开发环境有问题,因为它仍然可以正确编译并运行.
I think it is something wrong with the dev enviornment, because it still compiles and runs correctly.
推荐答案
我遇到了同样的问题,并且解决了这个问题.
I had the same problem and this solved it.
来源:
这篇关于名称空间"Mvc"的类型在名称空间Microsoft.AspNet中不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!