From the course: Visual Studio Essential Training

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

View call hierarchy

View call hierarchy

- [Instructor] Let's say you are looking at your code and you'll want to know whether this method is used anywhere in your application. This method here, CapPriceAtMaximum. There are some tools that can surface that information to us. One is the code lens, which we'll look at later in this chapter. In this video, we'll look at the call hierarchy command. Here's what it does, it displays call relationships. It shows all calls to a selected method or a selected property or a constructor. This helps us understand how different parts of our code interact. In addition, it helps us navigate to the code, just like we saw with go to definition. It has a context menu, so I'll right click on this method CapPriceAtMaximum, and then go to View Call Hierarchy. That opens this window across the bottom of the screen. This is divided into two sections. On the left is a tree view that shows all of the methods I'm looking at. I only have one at the moment, but I can add others to this list. I can get…

Contents