Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding calls of a method X in method Y

Is there a way in Visual Studio (i'm using 2013 Pro) to find all calls to a particular method X from method Y or one of the methods that were called directly/indirectly by Y (recursive that is)?

I considered the following two approaches, but both won't work in my case:

  1. Putting a breakpoint in X: This is not possible. The method is built-in.
  2. Finding all references to X: This is possible but will take considerable amount of time. Method X has been used in huge number of places.

I'm open to using a (free) plug-in if that is what it takes.

like image 834
dotNET Avatar asked Dec 06 '25 09:12

dotNET


1 Answers

I have a german IDE so maybe i use the wrong terms, but i'll try it anyway. You can use the visual studios Call Hierarchy function. Therefore right-click on the method X in Y and then click display call hierarchy. In the window below you can then expand the branch to your method Y and you only see all occurences of X there.

enter image description here

like image 189
Tim Schmelter Avatar answered Dec 07 '25 22:12

Tim Schmelter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!