VS 2019 - ASP.NET 核心 MVC 网络应用程序(用 C# 编写):全新项目出现多个错误

VS 2019 - ASP.NET Core MVC web app (written in C#) : multiple errors on brand new project

利用 ASP.NET Core 5.0 MVC 并用 C# 编写的全新项目。

我在查看任何默认 .cshtml 页面时在错误列表 window 中收到多个错误。

但是,该项目仍然可以正常构建和运行。

错误包括:

- The name 'ViewData' does not exist in the current context.
- The name 'RenderBody' does not exist in the current context.
- The name 'await' does not exist in the current context.
- The name 'Context' does not exist in the current context.
- The namespace "ASP" already contains a definition for '_Page_Default_cshtml' 

(完整列表 https://pastebin.com/YM5JnqBj

可能是你安装VS 2019时没有选择ASP.NET和.NET跨平台开发,只选择了其他环境进行开发。我在没有安装正确模块的情况下创建了 ASP.NET 项目。注意到这一点后,我回去安装了缺少的两个模块,但这并没有解决问题。 VS 2019后端部分链接未建立

最终解决方案——从头开始使用正确的模块重新安装 VS 2019(不要先尝试修复它)。现在所有助手,代码完整,Intellicode,一切正常

错误: