Visualize call stack of method calls in Visual Studio 2010

梦想的初衷 提交于 2020-04-11 05:00:13

问题


I wonder if there is a way to visually represent a call stack of a method.

Meaning for example:

  • ServiceAdapter.GetMessage
    • calls Manager.GetMessage
      • calls Agent.GetMessage
        • calls Repo.GetMessageById
      • calls Agent.GetUserById
        • calls Repo.GetUserById
      • calls Agent.GetRating
        • call Repo.GetRatingForMessage
    • ..

This way it would by very easy to navigate through a piece of code and visualize its dependencies.

Is there an existing extension for this in Visual Studio?


回答1:


You're looking for the Call Hierarchy window.
Select a method, then press Ctrl + K, T.




回答2:


On the method name, left click with your mouse and click Call Hierarchy.



来源:https://stackoverflow.com/questions/6058453/visualize-call-stack-of-method-calls-in-visual-studio-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!