19

I have a large-ish solution, with C# and VB.NET projects mixed. Whenever I try to “Go to definition” on a class, property or method that’s defined in the other language, Visual Studio just takes me to the Object Browser, which is pretty annoying. Same for debugging: I can’t step into a project that's written in the other language.

Is there a way to fix this?

6
  • 1
    Do you have project refs or Assembly refs?
    – Mrchief
    Aug 11, 2011 at 20:12
  • Are all projects targeting same Framework version? Aug 11, 2011 at 20:13
  • Release or debug build? (just tested -- shouldn't matter) Aug 11, 2011 at 20:17
  • possible duplicate of C# -->Go to Definition ==> VB.NET Aug 11, 2011 at 20:19
  • Both release and debug build has this behaviour. In fact, I'm pretty sure VS always has behaved like this.
    – Jakob Gade
    Aug 11, 2011 at 20:20

2 Answers 2

16

I have this problem too. As workaround I use Navigate to (CTRL + comma) instead of Goto Definition.

2
  • That's pretty neat. I've gotten so used to just slapping F12 that I forgot about the Navigate To feature in VS2010. Thanks! :)
    – Jakob Gade
    Aug 19, 2011 at 4:10
  • 5
    nice work, I thought I was a level 70 programmer orc, but the fact that I didn't know about this feature has led me to believe otherwise.
    – viggity
    Oct 18, 2011 at 19:10
15

See this seems like a reported bug

Find all references / go to definition do not work across VB/C# in same solution.

Quote:

The project-to-project reference between a C# and VB project is treated like a file assembly reference where all symbols are treated as if coming from metadata.

1
  • 2
    Thanks, that's pretty much what I feared. Fingers crossed they'll fix it at some point. :)
    – Jakob Gade
    Aug 11, 2011 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.