VS2019 ASP.NET MVC“无法导航到插入符号下的符号"

问题描述:

在Visual Studio 2019中打开现有的ASP.NET MVC项目时,在尝试转到定义"(F12)时,始终收到此错误消息无法导航至插入符号下的符号".

When opening an existing ASP.NET MVC project inside Visual Studio 2019 I keep receiving this error message "Cannot navigate to the symbol under caret" when trying to "Go To Definition" (F12).

此处的无法导航到插入符号下的符号"的其他答案都没有解决我的问题,直到我从Visual Studio开发人员社区找到了该解决方案.

None of the other answers on here for "Cannot navigate to the symbol under caret" solved my issue until I found this solution from the visual studio developer community.

这里是链接,以下是解决方案:

Here is the link and bellow is the solution from the post: https://developercommunity.visualstudio.com/content/problem/505489/cannot-navigate-to-the-symbol-under-the-caret-3.html

使用v1.0.0的项目正在发生这种情况Microsoft.Net.编译器.要变通解决此问题,您需要更新到最新的稳定版本3.0.0.为此,您可以请按照以下步骤操作:

This is happening to projects that are using v1.0.0 of Microsoft.Net.Compilers. To work around this problem you need to update to the latest stable version which is 3.0.0. To do that you can follow the these steps:

1)右键单击解决方案资源管理器中的参考"

1) Right click on "References" in the Solution Explorer

2)选择管理NuGet软件包"

2) Select "Manage NuGet Packages"

3)在已安装"标签下,从"Microsoft.Net.Compilers"中搜索

3) Under the "Installed" tab search fro "Microsoft.Net.Compilers"

4)选择"Microsoft.Net.Compilers"

4) Select "Microsoft.Net.Compilers"

5)在"Microsoft.Net.Compilers"的侧窗口中,单击更新按钮

5) On the side window of "Microsoft.Net.Compilers" click the update button

这应该允许您导航到定义

That should allow you navigate to definitions