1

I am using Visual studio 2017 Last Update (15.4.1) and Git source Control .

When I get Latest Update some files that My co-worker had added are unknown and I cant use them. when I press Go to Definition I've got this Message

cannot navigate to the symbol under the caret

but when I clone Project again from Source Control It works fine .

Is it related Not Same visual studio Version ?

osman Rahimi
  • 1,427
  • 1
  • 11
  • 26
  • How do you "get Latest Update"? Maybe the project/folder structure within the IDE is not in-sync with the file system and needs to be refreshed. – Matthias Nov 14 '17 at 01:32
  • I use sync then press poll . When I make a change in one of those unknown files and save it all of them are work well . Every time When I face with this problem I have to make a change in one of them like rename its name then rename again to original name – osman Rahimi Nov 14 '17 at 03:07

4 Answers4

3

Please see the bug fix page from Microsoft at GitHub. This is the ticket #20779, which is fixed in the Visual Studio 2017 version 15.3 (However, you're using 15.4.1, It's should be fixed.)

Based on the ticket, the problem only happened with generic types. It turns out the problem only happens when trying to navigate to a type where one or more of the generic type arguments is a user defined type. So you can Go To Definition on List, but if you try on List, you'll get this error: "Cannot navigate to the symbol under the caret".

So, you can try to temporarily change types to int, then undo. See what's happen.

In your scenario, maybe you can use other approach, such as, empty the symbol cache, clean the solution and recompile, reset the visual studio user data, disable extensions, close all documents, clear various caches and temporary files first. Then you can sync project.

Ortsbo
  • 175
  • 1
  • 7
  • It seems good, due to my problem fixed now I can't try this one . are you tried this? – A.D. Nov 14 '17 at 06:17
3

I got the problem merging a project file with others. After a long r&d, I fund some of the help contents. May these help you I also try them. This one works for me.

Close all open files and then VS Clean solution Rebuild solution

this is the most preferred help content in my opinion.

A.D.
  • 2,352
  • 2
  • 15
  • 25
0

Going back to VS 2015 there is no solution for this. A huge setback to lose this feature. It is not fixed in the latest release, contrary to everyone saying it is.

CDevVS
  • 1
0

thanks. "Rebuild Solution" can fix the problem.

enter image description here

Problem: Show "Cannot navigate to the symbol under the caret." after click "go to definition".

enter image description here

enter image description here

markmolamhoi
  • 131
  • 1
  • 4