March 11, 2010

View Call Hierarchy in Visual Studio 2010




Visual Studio 2010 contains a very useful feature called ‘View Call Hierarchy’. This feature lets you dive into all the calls that are made ‘to’ a method, property or constructor as well as all the calls that are made ‘from’ that method, property or constructor. As given in the documentation “You can examine several levels of code to view complex chains of method calls and additional entry points to the code, which enables you to explore all possible execution paths

For example, right clicking on the LogOff() method brings up the ‘View Call Hierarchy’ option in the context menu

View Call Hierarchy

Clicking on the ‘View Call Hierarchy’ option brings up the following window which displays the calls that are made to LogOff() as well as the calls that are made from LogOff().

View Call Hierarchy

Double clicking these calls takes you to the specific line of code where the call is made from or where the call is made to. Extremely handy!



'Like' us on our FaceBook page if you find this blog useful. Thanks!


Did you like this post?
kick it on DotNetKicks.com Save on Delicious
subscribe via rss subscribe via e-mail
print this post follow me on twitter


About The Author

Suprotim Agarwal, ASP.NET Architecture MVP works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He has also written an EBook 51 Recipes using jQuery with ASP.NET Controls.

Follow him on twitter @suprotimagarwal

comments

2 Responses to "View Call Hierarchy in Visual Studio 2010"
  1. Greg said...
    March 12, 2010 7:29 AM

    Netbeans displays the call hierarchy as a graphic image. It has been available in the last few versions.

    I started my recent C++ job without having any experience with an IDE. The company provided VS 2008 and Netbeans. I learned both, side by side. My favorite is Netbeans.

    Netbeans has click through navigation, dock/undock windows, a better user interface for searching, and search results are kept around in tabs so you can refer to previous searches. And no expensive license.

  2. Nenad Šelić said...
    June 15, 2011 12:10 PM

    Is possible to run call hierarchy from csharp code?

 

Copyright © 2009-2012 All Rights Reserved for DevCurry.com by Suprotim Agarwal | Terms and Conditions