Go to definition & Find all references do not work in Visual Studio

12,820

Solution 1

Have recently upgraded to VS2013 and can tell you that when you click on a function name where it is defined the "Find All References" option used to show all the places in the solution where the function was called. All it does now is show you the one you're already looking at.

In front of me now I have line 218: Public Shared Function MyNewFunction(ByVal test As String)

If I right click on MyNewFunction and select "Find All References" the output window says "Find Symbol Results - 1 match found" and it's the same function name, file and line number as above. So it is effectively useless.

Unless of course, there is some hidden setting that we haven't seen yet?

Solution 2

Currently I only have an Express Edition available. I tried it with VS2013 Express with newly created empty projects the way you described them (i.e. VB -> C# -> VB). I see all of the behavior you described, but VS2012 Express shows exactly the same behavior.

Thus, I fear reinstalling won't help.

I usually work with solutions that contain several projects, and Go To Definition etc. work very smoothly across projects, but I never worked with a solution containing projects using more than a single language.

I guess the feature you are missing, "smoothly working IntelliSense across projects using different .NET languages", has never been implemented.

Update: VS2010 behaves the same way.

Solution 3

I encountered a similar issue in VisualStudio 2010, where the "Find All References" command disappeared after quite a while of normal usage.

Using the shortcut keys would display a message along the lines of "not currently available", while attempting a "Go To Definition" would display an error dialog.

Exiting and re-opening Visual Studio did not fix the issue, and I couldn't find any settings that would change the situation.

Oddly, the issue was restricted to one source code file, and not the other.

Out of curiousity, I closed the effected source code file, then re-opened it by double-clicking the file in solution explorer, and this fixed the issue.

My best guess is that something corrupted the cached index on the file, and doing a close and re-open prompted Visual Studio to refresh this cache.

Share:
12,820
404compilernotfound
Author by

404compilernotfound

Objective-C/Cocoa Touch, SQL Server, VB.NET, C#.NET, JavaScript

Updated on June 22, 2022

Comments

  • 404compilernotfound
    404compilernotfound almost 2 years

    I have a Windows Forms solution in VS 2013 Pro that has several projects in both VB and C#. One of the dependencies looks like this:

    Startup Project, SP (VB)
        Custom Controls Library, CL (C#)
           Utils/Constants Library, UL (VB)
        UL (again, referenced directly from SP)
    

    My problem is that when I Go To Definition from SP to CL, it takes me to the Object Browser. When I Go To Def from CL to UL, it brings up metadata. But when I Go To Def from SP to UL, it works fine. Also, when I Find All References of a control in CL, it doesn't show the SP references, but when I do it from SP, it shows references in both SP and CL.

    I have searched on StackOverflow, MSDN, and several other forums, and tried all suggestions I've found: I have removed all references and rebuilt them (I am 100.0% sure they are all project references, not file references). I have completely deleted my solution file and added the projects from scratch. I have ensured that the GUID in the references matches that of the references. They are all being built with the same framework, and all for the same processor type. All projects are producing pdb and xml debug files. I assume that VS2013 did away with IntelliSense database files, as I cannot find any of them on my disk to delete (or I would have tried it!).

    Another interesting (I'm assuming related) detail is that method/property renames in CL are not reflected in SP. Not only are the SP subclasses' symbols not renamed, but Visual Studio doesn't even alert me to this error until I have rebuilt. So, it seems as if IntelliSense is corrupt, or there is something else I'm missing.

    I am really at a loss. As far as I can remember, this functionality has worked. I can't say for sure whether it worked since upgrading from 2012 to 2013. Is anyone having the same experience? I have disabled add-ons, rebuilt solution, re-added project dependencies… and I would reinstall Visual Studio, but don't really want to lose several hours of development doing that if there is a simpler method.

  • 404compilernotfound
    404compilernotfound about 10 years
    Thanks for testing it out! I couldn't remember if it worked correctly in 2012 or not. I will test this for a different solution at work (in 2008). My prediction is that I will see the same behavior.
  • Resource
    Resource over 8 years
    Craig, did you find a solution to this? I migrated from VS2008 to VS2015 yesterday and I'm astonished and disappointed to find that 'Find all References' is broken, exactly as you describe. I'm tempted to revert to 2008!