0

I need to write some functionality to build a call tree given an assembly i.e. I want to know that method A of some type calls methods B and C or other types.

I've looked around within the Reflection API but don't see any ready way to accomplish this. can anyone point me in the right direction?

ekkis
  • 8,231
  • 11
  • 44
  • 85
  • 1
    Do you want to parse the code and figure this out, or run the application and "see what was called"? – Patrick Sep 09 '13 at 22:13
  • 1
    I marked your question as duplicate, and you should try to read the referenced question to learn how to use Cecil, an open source library to parse the assemblies and extract the information you want. Another option is from Microsoft, called CCI, http://ccimetadata.codeplex.com/ – Lex Li Sep 10 '13 at 03:31
  • @LexLi, that other article is exactly what I was hoping for. perhaps you want to post it here as an answer so I can tag it as accepted – ekkis Sep 10 '13 at 23:45
  • If possible, vote to close this question as duplicate, or post what I suggested as an answer of your own and then accept it :) – Lex Li Sep 11 '13 at 02:04

1 Answers1

0

If you want to do this programmatically, here is a good article: http://msdn.microsoft.com/en-us/magazine/cc163641.aspx

Or you can use tools such as Visual Studio to generate diagrams for you. See: http://msdn.microsoft.com/en-us/library/vstudio/dd409453.aspx

http://msdn.microsoft.com/en-us/library/vstudio/ff657806.aspx

Fanblade
  • 444
  • 2
  • 8
  • Reflector is no longer a free tool, so the very first article is no longer valid. The following ones refer to VS, but that's not what @ekkis wants IMHO. – Lex Li Sep 10 '13 at 03:29
  • thanks for the reply. I started to read the articles but I see that with very little code (as per Lex Li's suggestion) I can do what I wanted to do. thanks all the same – ekkis Sep 10 '13 at 23:46