1

ide: vs 2012 v11.0.60610.01 update 3 project: web site, mix of vb and c# problem: vb navigates to definition, c# navigates to metadata complaint: complete pain in the ass when managing a 30k code-line project. solution: you be the first to figure this out, it's beyond my level of patience.

i find metadata to be 110% useless. is there ANY way to get c# to navigate to the actual definition like vb does?

thanks

joeydood
  • 11
  • 1
  • 2

3 Answers3

2

If it's navigating to the metadata, rather than the definition, it probably has to do with how your assemblies were added. If you add a reference as a DLL, it will always show metadata, even if that project is included in your solution; you have to add a reference by project to have access to the source.

wilso132
  • 829
  • 5
  • 10
  • thanks but no, i'm not asking for definitions to methods embedded in dll's. i wrote all the raw code it is using. the definitions are contained in .vb and .cs files, not dlls. why does c# NOT navigate to the definition instead of presenting me with useless metadata??? – joeydood Aug 28 '13 at 15:34
  • 1
    @joeydood I realize that you're asking why it's showing metadata on code you own... the answer I gave is the answer as to why. Just because you own the code a DLL doesn't mean that's how it was added to your project. Try adding/removing a reference and ensuring you add it *by project* and not by DLL and see if you can navigate to it. – wilso132 Aug 28 '13 at 15:36
  • @joeydood the only other explanation is you're trying to navigate something like a WCF service reference, but I think VB handles that the same way... – wilso132 Aug 28 '13 at 15:36
  • btw, 'find all references' = junk; why doesn't visual studio 2012 find all references like it should? this would be an acceptable alternative to the dysfunctional 'goto definition' (should be renamed for c#: goto worthless metadata). – joeydood Aug 28 '13 at 15:55
  • to be clear, i am only trying to navigate to methods included in the same project, methods within .vb or .cs files. the classes which contain the source methods were added to the project with the 'add -> new ->...' method, they were not added by reference. they were all written from scratch. THANK you everyone for your replies so far! – joeydood Aug 28 '13 at 16:02
  • @joeydood just to clarify, do you mean methods in the same project (.csproj) or methods in the same solution (.sln)? There's a big difference. – wilso132 Aug 28 '13 at 16:44
  • this project was originally a 'web site' and recently i converted it to a solution. it seems i've had the same issue regardless of the project type. even in vs2010. thanks so much for your help so far! – joeydood Aug 28 '13 at 17:25
0

"i find metadata to be 110% useless. is there ANY way to get c# to navigate to the actual definition like vb does?"

Resharper's go to definition/go to implementation options work exactly as you'd expect - worth trying it to see if it fixes your issue.

This question might be of help if you choose not to try resharper

Community
  • 1
  • 1
NDJ
  • 5,189
  • 1
  • 18
  • 27
  • The Resharper tool is only useful in going to implementations of an interface, rather than just going to the interface. I'm not sure if that's the issue he's encountering or not; "metadata" normally means they're just pulling info from the DLL. – wilso132 Aug 28 '13 at 15:31
0

I realize this is an old thread, but it seemed to be one of the few that focused on the role of mixed languages (C# and VB.NET) as a contributing factor to this.

I ran a few tests across VS.NET 2010, 2012, 2013, and 2015. My empirical results (not validated by any official Microsoft documentation) is that all 4 support Find All References of VB.NET members consumed by C# (albeit, split into apparently separate result groups), as long as project references were added. However, VS.NET 2010, 2012 and 2013 end up in the "from metadata" view for Go To Definition from the C# code to a VB.NET member. Where as VS.NET 2015 appears to have this cross-language Go To Definition navigation working correctly.

I also confirmed that using Resharper's support for External Sources does allow Go To Definition to work under VS.NET 2012, and that almost motivated me to purchase licenses for Resharper for our current project that has mixed C# and VB.NET projects, but now my plan is just to expedite adopting VS.NET 2015.

Peter Jaffe
  • 301
  • 3
  • 5