Reputation: 147
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.
Upvotes: 5
Views: 15496
Reputation: 129
It's almost 9 years later and I was having this problem in Visual Studio 2022 (Version 17.4.3).
It turns out that one of my ".h" files wasn't included in my project. It still compiled, but it seems to have confused the heck out of "Find All References". Specifically, "Find All References" stopped working correctly in any ".c" or ".cpp" file that #included the offending ".h" file.
Right-clicking the ".h" file in Solution Explorer and choosing "Include in Project" seems to have fixed it.
Upvotes: 1
Reputation: 1605
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.
Upvotes: 1
Reputation: 1794
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?
Upvotes: 3
Reputation: 5234
I had the same problem of trying to find the Find All Refs
option, and found it has nothing to do with multiple languages or the version of VS, but just with excluded files. In the Solution Explorer you might see a vague, dotted, file icon, like with my file CenterConverter.cs
:
While normal files have a right-mouse-click menu option for Exclude From Project
, the dotted-icon source file has one for Include In Project
.
Looking at the Properties for an excluded file, you will see that the Build Action
(Compile or not) and the Copy To Output Directory
properties are missing.
By including the file in the project, it will be compiled, and options like Go To Definition
and Find All References
start to make sense.
Upvotes: 0
Reputation: 2086
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.
Upvotes: 2