'Visual Studio's "go to definition" goes to a wrong function/line?

So this happened after my project got to around 6-7k lines of codes, for some reason go to definition goes to a wrong line for some of the functions, mostly old functions that i wrote at the start of this project. But it does work for new functions that i write.

Most importantly, this only happens for old functions inside of a specific .c file. (I'm writing a C program and do include header files and define every function that i use in the corresponding .c file, not sure that matters or not tho).

So when i use an old function inside of that .c file and try to use F12, it goes to a wrong line/function, almost feels like its going to its old line number.

I'm using visual studio 2019, how can i fix this?



Solution 1:[1]

Try this:

  • Close VS
  • Delete the .vs folder
  • Reopen VS

Works for me

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pedro77