Finding references in Visual Studio – an annoying behavior

A good tool from Visual Studio 2005 is the “Find all references” in the context menu. However, it has a annoying behavior in a common situation within my project.

Suppose I have the A, B and C classes that implements the I interface, and that interface has declared a method named “save”. Now, I want to know where in my code the method C.save() is called, and usually I would right-click the method name in the method definition at the C class and use the “Find all references” tool. However, if I do this, the Visual Studio tool will find all the references of any “save()” method of the project, even of the A or B classes.

The best behavior of this tool would be finding only the references of the “save()” method called from instances of the C class.

Leave a Comment