Go To Definition: “Cannot navigate to the symbol u

2019-01-16 13:41发布

I suddenly started experiencing a problem today in my project where clicking Go To Definition gives me a strange error: "Cannot navigate to the symbol under the caret."

enter image description here

I first noticed it some time after installing Costura.Fody via NuGet. I've since uninstalled it but the problem persists. I've cleaned and rebuilt the solution multiple times. There are no instances of "Fody" or "Costura" anywhere in my git commit history, before or after the point in time when this started happening, so I'm thinking that one of my .gitignore'd files is stuck in a bad state.

The problem only occurs if the definition being targeted is in another file; Go To Definition for something in the currently opened file works fine. Peek Definition works fine too. Other solutions/projects work fine as well -- it's only this one that's causing issues.

I'm using Visual Studio 2015. The issue doesn't seem to occur in the 2013 version.

Why does this error occur and how can I fix it?

30条回答
不美不萌又怎样
2楼-- · 2019-01-16 14:01

I tried David's solution (the one about clicking Empty Symbol Cache option) but it didn't work for me.

How did I solve it?

  • Close all files
  • Clean solution
  • Rebuild solution

For me this error does not make sense but I solved doing this!

查看更多
戒情不戒烟
3楼-- · 2019-01-16 14:03

If you recently installed an add-in, consider uninstalling it. That's what worked for me.

查看更多
Evening l夕情丶
4楼-- · 2019-01-16 14:04

I have the same problem after update visual studio, so this is how do I solve the problem.

  1. Close visual studio.
  2. Delete all .vs folder from my project.
  3. Open visual studio.
  4. Open my project.

Hope this helpful for anyone who has this problem.

查看更多
forever°为你锁心
5楼-- · 2019-01-16 14:04

After doing a "devenv.exe /resetuserdata", my VAssistX fails, so, actually, this reminds me that VAssistX can resolve the problem by Goto Implementation (Alt+G).

查看更多
我欲成王,谁敢阻挡
6楼-- · 2019-01-16 14:04

For me the navigate works just NO XAMARIN SOLUTIONS. That suggestions here DIDN´T WORKS. :( Devenv.exe /resetuserdata not works for me.

My solution was: Re-create the solutions, project, folders and works. No import. Detail: my project was on the VS 2015, the error was on the VS 2017.

查看更多
We Are One
7楼-- · 2019-01-16 14:07

The answer above is correct, but the path is slightly off, try this instead:

%AppData%\..\Local\Temp\TFSTemp
查看更多
登录 后发表回答