ASP.NET MVC问题 - 找不到命名空间

时间:2022-06-02 16:46:49

Basically any place that a MVC resource is needed in my application, it is being listed in the error list (234 errors, almost every single one is the exact same error).

基本上我的应用程序中需要MVC资源的任何地方,它都列在错误列表中(234错误,几乎每一个都是完全相同的错误)。

I am able to get intellisense when I type System.Web.Mvc., and add a Controller, but after building, the line which the Controller was added to shows in blue font, but it is underlined.

当我键入System.Web.Mvc。并添加一个Controller时,我能够获得intellisense,但是在构建之后,添加了Controller的行以蓝色字体显示,但它带有下划线。

I have literally tried so many solutions from Stack, most often discussed is:

我从Stack那里尝试了很多解决方案,最常讨论的是:

  • Remove reference to System.Web.Mvc and re-add. Set copy local to true.
  • 删除对System.Web.Mvc的引用并重新添加。将copy local设置为true。

Screenshot of subset of errors below.

以下错误子集的屏幕截图。

ASP.NET MVC问题 - 找不到命名空间

I am surprised that it is being flagged here, when it is recognizing Controller in the inheritance.

当它在继承中识别Controller时,我很惊讶它被标记在这里。

ASP.NET MVC问题 - 找不到命名空间

Here too

ASP.NET MVC问题 - 找不到命名空间

1 个解决方案

#1


0  

This is never the nice answer... I recreated the solution, and very carefully chose all of my options when configuring. I built to the browser after all changes, and so far everything is working out.

这绝不是一个好的答案......我重新创建了解决方案,在配置时非常仔细地选择了所有选项。我在所有更改后都构建了浏览器,到目前为止一切正常。

Thanks.

#1


0  

This is never the nice answer... I recreated the solution, and very carefully chose all of my options when configuring. I built to the browser after all changes, and so far everything is working out.

这绝不是一个好的答案......我重新创建了解决方案,在配置时非常仔细地选择了所有选项。我在所有更改后都构建了浏览器,到目前为止一切正常。

Thanks.