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!






About The Author

Suprotim Agarwal
Suprotim Agarwal, Developer Technologies MVP (Microsoft Most Valuable Professional) is the founder and contributor for DevCurry, DotNetCurry and SQLServerCurry. He is the Chief Editor of a Developer Magazine called DNC Magazine. He has also authored two Books - 51 Recipes using jQuery with ASP.NET Controls. and The Absolutely Awesome jQuery CookBook.

Follow him on twitter @suprotimagarwal.

2 comments:

Async said...

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.

Nenad Šelić said...

Is possible to run call hierarchy from csharp code?