Continuing from here.
Ch-7: Digging into the source code
In this chapter, Mike describes the tools that work with, around or towards source code: Idlasm, Reflector and FxCop. The book is written for Visual Studio 2003, so some references are slightly outdated - but there is one utility that stands out and is still more useful than ever: Lutz Roeder's Reflector. It is part of the Visual Studio 2005 (albeit in older version that you can get on the Web site).
Here is in a nutshell what does it do for you: it lets you load a compiled assembly (.exe or .dll), shows content of all classes, functions, etc contained in that assembly. It contains built-in disassembler, which is amazingly good. It also contains analyzer, which shows you - at binary level - what functions/methods are called from a given class method or which classes call this method as well as inter-assembly dependencies. Extremly valuable when debugging some low level DLL loading issues.
Reflector has also inspired many add-ins: see the Lutz's blog, or Add-Ins page on CodePlex. The addins do lot of different things: compute and display code metrics, allow to do binary compare of different versions of same assembly, graphically display interdependencies between assemblies, generate unit test stubs ... make your choice.
Author Miro Adamy
License (c) 2006-2020 Miro Adamy