Thursday 7 February 2013

Tool - View .NET Assembly References Mappings.exe

Here is a ‘simple’ .Net mini-tool that shows two TreeViews with .Net assemblies reference's dependencies (I used it today to figure out how many dependencies a particular dll had).

You can download this O2 Platform tool from: Tool - View .NET Assembly References Mappings.exe (5Mb)

Here is what it looks when executed for the first time:

image

On the left you have the original assembly (in this can the actual Tool - View .NET Assembly References Mappings.exe) and the dlls it depends on.

On the right you have the XRef mappings of each assembly loaded on the right:

image

Where this gets interesting is if you drop a folder into the left-hand-side TreeView:

image

All dlls are loaded (on the left) and the XRefs (on the right) show more mappings:

image

The loading and mapping of dlls is very quick, for example it took about 2 seconds to load and map 81 assemblies:

image

The 'REPL Selected Assembly' ToolStrip Button, will open a C# REPL for the assembly selected (on the left TreeView)

For example here is the AWSSDK.dll assembly:

image

Once we have a dll loaded,  we can (for example) list it classes using reflection:

image

Note 1: you probably noticed that I used and packaged ILSpy (in order to use Mono.Cecil) as one of the dependencies, so a cool improvement of this script would be to fire up ILSpy from here, or even better to show its main decompilation GUI (TreeView and decompiled code).

Note 2: The script that created this tools is at GitHub: Tool - View .NET Assembly References Mappings.h2