Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visual studio right click missing find all refences and go to definition disabled

I am using Visual Studio 2010, suddenly from right click menu Go to Defination option is disabled and even F12 does not work. Find all referneces option is missing from the menu... i use them a lot, how can I get them work

like image 637
msbyuva Avatar asked Jan 25 '13 19:01

msbyuva


People also ask

Why is definition disabled in Visual Studio?

Answers. Don't close Visual Studio but close all the files and open them again by clicking on the file in the solution. The file might have been opened by Source Safe or you maybe opened it from Windows Explorer. In this case the file doesn't get assosiated with your solution and the Go to Def.

How do I enable definition in Visual Studio?

Go To Definition If you are a keyboard user, place your text cursor somewhere inside the symbol name and press F12. If you are a mouse user, either select Go To Definition from the right-click menu or use the Ctrl-click functionality described in the following section.

How do I enable to define code in Visual Studio?

Go to Definition# If a language supports it, you can go to the definition of a symbol by pressing F12. Tip: You can jump to the definition with Ctrl+Click or open the definition to the side with Ctrl+Alt+Click.

How do I enable peek in Visual Studio?

You can peek a definition by choosing Peek Definition from the right-click menu for a type or member that you want to explore. If the option is enabled, you can also peek a definition using the mouse, by pressing Ctrl (or another modifier) and clicking the member name. Or, from the keyboard, press Alt+F12.


2 Answers

I had the same problem with Microsoft Visual Studio 2013 Premium.

Fixed it by following the steps:

  1. Close your solution.
  2. Delete hidden .suo file in folder where your solution's .sln file exists.
  3. Open your solution.
  4. Rebuild your solution.

F12 should now work.

like image 98
Roel van Lisdonk Avatar answered Oct 12 '22 09:10

Roel van Lisdonk


To reiterate what @eodabash said on 2014-04-07 was EXACTLY it.

I'm using Visual Studio 2013 Premium and I too lost Go To Definition functionality when the file was file containing the class was not opened.

Resolution:

  1. Tools > Options > Text Editor > File Extension
  2. Notice extension, "cs" was missing from list.
  3. Type, "cs" in the Extension box
  4. Select, "Microsoft Visual C#" under Editor
  5. Click, Add. Click, Ok.

BOOM!

My issue was NOT an extension. It was NOT the .suo files. It was NOT a reinstall issue. It worked in C++ but NOT C#.

It WAS the file extensions option were not associated with C#. (facepalm)

like image 36
Damian Avatar answered Oct 12 '22 09:10

Damian