问题
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).
回答1:
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
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) Right click on "References" in the Solution Explorer
2) Select "Manage NuGet Packages"
3) Under the "Installed" tab search fro "Microsoft.Net.Compilers"
4) Select "Microsoft.Net.Compilers"
5) On the side window of "Microsoft.Net.Compilers" click the update button
That should allow you navigate to definitions
来源:https://stackoverflow.com/questions/55737784/vs2019-asp-net-mvc-cannot-navigate-to-the-symbol-under-caret