This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

Visual Studio
VS 2005+

Visual Studio Find All References

It is common to wish to find all of the places in a project or solution where a particular symbol, such as a class or method, is used. This can be essential before performing manual refactoring. Visual Studio's Find All References command makes this easy.

Finding References

When you are modifying existing code or when debugging software that is not working correctly, it can be useful to find every place in a solution where a method is called or some other symbol is used. To locate all references to an item you can use the Find All References command in Visual Studio. This feature searches the entire solution for any reference to a chosen item. It can be more useful than the standard searching tools as it finds only true references, rather than all items with the same name.

To use the command, right-click the symbol you wish to find. Choose "Find All References" from the context-sensitive menu that appears. You can also position the text cursor, or caret, on the desired symbol and press Ctrl-F12. For either method, the Find Symbol Results pane, pictured below, will be displayed.

Visual Studio Find All References Results

In the above image, a textbox named ResultsBox was searched for. Each line in the results represents a reference to this symbol. The lines include the file name and path of the file in which the item was found, the location within the file that it appears and a snippet of the source code at that location with the search item highlighted. To view the code in an editor, you can double-click one of the lines.

3 May 2010