1.2.19 Finding Code With Find All References

Find All References Shows Where a Symbol Is Used

As a solution grows, a class or field may appear in several files.

Visual Studio's Find All References command helps answer:

Where is this class, field, or other symbol used?

This is safer than visually scanning every source file.

Start from the Symbol

Place the cursor on a symbol such as:

Plain text
Player

or:

Plain text
team

Then use Find All References.

In current Visual Studio documentation, the command is available from the symbol's context menu, and Shift+F12 is a common shortcut.

Read the Results by Location

The results can show references across the solution.

For a field such as:

Plain text
team

you might find:

That gives you a map of how the field participates in the source.

Use References Before Renaming or Revising

If you are considering a change, Find All References can show how many places depend on the symbol.

This does not automatically mean you should edit all results.

It gives you evidence about the impact area.

Find All References Is Not a Text Search

A text search looks for matching characters.

A reference search works with the code symbol recognized by the IDE.

That can make the result more useful when similar words appear in comments or unrelated code.

Use the Tool for Understanding

A productive question is:

Which parts of this application depend on the Player class?

Find All References can help you trace the structure before you make a change.