I want to find all calls to DateTime.ToString
references in my assembly. In Visual Studio you can "Find All References" by right clicking on ToString
; however, that returns all references to ToString
for all classes and not just DateTime
.
A regular search for DateTime.ToString
won't work because of the following example:
DateTime myDate = new DateTime();
myDate.ToString();
Any suggestions?
You should use ReSharper for that.
Steps:
myDate.ToString();
ToString
tokenFind Usages Advanced ...
menu itemFind
In VS2015 when you try to Find References for override method, you have them grouped by type in
Results like this:
Find Symbol Results
In Visual Studio 2019, right-click on the desired method name, and then click "View Call Hierarchy." A "Call Hierarchy" window appears at the bottom (by default) of Visual Studio. In the left pane, you'll see a tree representation of the projects that call the method. Within each project, the first item is "Calls To [MethodName]." Expand this first item for a list of methods. Clicking each method will change the right pane of the "Call Hierarchy" window to show the lines where the method is called. Double-click these lines to go to them and address them individually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With