Visual Studio “Go to definition” disabled or gray out

前端 未结 12 1319
你的背包
你的背包 2021-02-03 21:59

Visual Studio\'s Go To Definition is disabled and F12 doesn\'t work. Other commands like Alt-F12 may continue working.

相关标签:
12条回答
  • 2021-02-03 22:30

    I found that I had to remove my TFS mapping: VS 2010 > open Team Explorer > Drill into the team project > double click source control > right click on the team project in the left pane and do "Remove Mapping" > after everything was removed I manually went to the local folder and deleted any lingering files > back in source control explorer I re-mapped to the same local folder and re-pulled all the code. Now the "go to definition" works again.

    Not sure why I had to do this...

    0 讨论(0)
  • 2021-02-03 22:32

    This also happens, if Visual Studio has files opened, which are not in the current Solution.

    I don't know how I got to this state, where files of a different solution where open as I didn't open them manually, but a quick check of the file path showed that those weren't files of the opened solution.

    Therefore, "Go to Definition" was disabled.

    0 讨论(0)
  • 2021-02-03 22:36
    1. Close the solution.
    2. Delete the intellisense database file for the solution: [solution].ncb or [solution].suo
    3. Reopen the solution.
    4. Optional: Rebuild the solution.
    0 讨论(0)
  • 2021-02-03 22:41

    Note that this can also be as a result of disabling database for C++/C#.

    In Tools - Options, type "IntelliSense" into the search box, and click on C/C++ - Advanced. In the Browsing/Navigation section, change Disable Database to False, if it is not so already.

    After re-enabling, close and reopen to force rebuild. NOTE: IntelliSense will produce large files on disk (*.sdf and ipch) that should be excluded from Git, for example.

    0 讨论(0)
  • 2021-02-03 22:41

    Just open the Solution using Windows Explorer, instead of opening it from inside VS...

    0 讨论(0)
  • 2021-02-03 22:42

    Check dll in references which is yellow. Remove it and add again.

    0 讨论(0)
提交回复
热议问题