Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I miss being able to hit F12 and going to the definition of a method. Because my solution consists of like four separate projects, when I hit F12 and the method (or property, or whatever) is in another project, it opens up the completely worthless object browser. Is there some setting I can fix so that it will just go to the correct file and method? Or am I pretty much SOL...

Thanks

share|improve this question
    
This question is not off-topic here, but I suspect you'll find more Visual Studio users on Stack Overflow. –  CarlF Apr 12 '11 at 20:35
    
@carlf i thought about that but figured it would be redirected here because it's not "programming related" –  Jason Apr 12 '11 at 20:54

4 Answers 4

This still works for me. It may be you installed an addon/extension which remapped F12.

To reset it, you can go toTools > Customize then click the button at the bottom of the dialog which says Keyboard.... In the dialog that comes up, type Edit.GoToDefinition in the Show commands containing: textbox.

Set Use new shortcut in: to Global.
Press F12 in the Press shortcut keys: textbox.
Click Assign.

You can then OK your way out of the dialogs, and that should restore the functionality.

share|improve this answer
1  
Doesn't work :\ The F12 key works when you're looking for a definition within the same project, but when you are looking for a definition in a different project (still within the same solution, of course), it just opens the object browser. –  Jason Apr 12 '11 at 20:20
    
Hmm, I just tried it here. I have a solution which has about a dozen different projects in it. I went to a file in one project which references a class in another project, highlighted it, clicked F12 and it took me to the class file. It may depend on whether, when you added the reference to project A in project B, if you selected project A in the Projects tab or the Assemblies tab of the Add Reference dialog. –  eidylon Apr 12 '11 at 20:39
    
in my references, the projects are referenced for both of the other projects :\ –  Jason Apr 12 '11 at 20:49

I found that a recently installed code productivity tool (Telerik JustCode) had hijacked the F12 hotkey. F12(Global) was still associated with GoTo Definition, but apparently the F12(Edit) was taking precedence. There was something wrong with my JustCode install, so it was not working, and F12 utlimately no longer worked.

Since I wasn't really using JustCode, I uninstalled it. After doing this, F12 began to do what it was supposed to do.

share|improve this answer
    
thanks for the tip. i will try this out when i get home! –  Jason Mar 28 '12 at 17:20

I found that if the reference project targets a different framework (ie my application is 4.0, but my model in 3.5), F12 goes to the object browser.

When the reference targets the same framework, F12 works . . .

share|improve this answer
    
interesting. i'll check this out. thanks for the answer.. this still doesn't work for me to this day! –  Jason Jul 27 '12 at 20:59
    
Upvoted as this was exactly the problem I was having. VS2008 imported .NET 3.5 class library but website was built from scratch as .NET 4 website. Changed class libraries to v4 and F12/go to definition works fine –  munrobasher Aug 27 '12 at 17:12

You probably have added a binary file (dll) as your Reference. Try the following in Solution Explorer:
(1) under your client project, expand References
(2) locate and remove the reference to the class containing your method/property
(3) under the same client project, add new References
(4) click on the "Projects" tab in the "Add Reference" dialog
I am assuming that your Solution includes both projects.

share|improve this answer
    
tried it... still goes to the object browser. wtf –  Jason Apr 12 '11 at 20:52
    
hmmm... sorry to hear... just for the heck of it, can you repeat the same steps, but this time save your client project after removing the reference (step 2) and then restart (close and open) Visual Studio and continue with steps 3 and 4. (if you attempt to compile between 3 and 4, you will get a lot of Errors, but this would only be temporary) –  Arun Apr 12 '11 at 21:07
1  
Also, just out of curiosity, when you right click on the properties and methods and choose "Go To Definition", do you get the same behavior as "F12"? –  Arun Apr 12 '11 at 21:09
    
@arun yes, i get the same behavior when i right click and hit go to definition and F12. it's suuuuper frustrating –  Jason Apr 13 '11 at 15:24
    
Usually when you add a Project Reference (instead of a dll Reference) into a consuming Project, the project file will hold the information that the referenced module is a Project available in the solution and not the binary. Try to open the consuming Project in Notepad (or any text editor) and search for the referenced module. If you see that under a "Reference" tag (like in "<Reference Include=yourDll>", there lies your problem. Just remove it and add this:under –  Arun Apr 13 '11 at 16:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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