.NET logo

.NET assembly dependency analyser

home | software | .net dependency analyser

After manually drawing an assembly dependency graph for a twenty-something-project solution in 2003, I tackled the task of doing this in software. The application I wrote is now hosted on Google Code for public use and collaborative improvement.

How it works

Run the application, and open a .NET assembly from the File|Open... menu (or just press CTRL+O). The analyser will immediately generate a diagram such as the one shown:

Example screenshot from .NET Assembly Dependency Analyser graph.

Most assemblies will reference large numbers of system assemblies, either directly or indirectly. In this graph, both the System and mscorlib assemblies are referenced by almost all other assemblies. The diagram is clearer without these explicit references.

See this graph, exported as a PNG file.

Example of the exclude menu showing how to omit selected assemblies from the graph.

Select which assemblies you want to include in the plot and press OK.

A graph showing dependencies when most of the behind-the-scenes assemblies have been removed.

This plot tells us a great deal about the analysed assembly (in this case, Drew.DependencyAnalyser.Tests.dll). It requires 3 non-system assemblies: Drew.DependencyAnalyser, Drew.DependencyAnalyser.Tests and nunit.framework, even though nunit.framework is not referenced directly. We can also tell, unsurprisingly, that Drew.DependencyAnalyser uses WinForms assemblies.

Note the circular dependency between System and System.Xml!!!

Excluding all System assemblies shows all dependent assemblies that must be deployed with the selected assembly for it to operate properly.

A graph showing uncluttered core dependencies when all framework and other supporting assemblies have been removed.

Here's an example of the SVG output.

The graph

The graph is produced via a Dot script. WinGraphViz is a COM component that generates Dot images, and is used by this application. It must be installed for the .NET dependency analyser to work.

A Dot script may look something like this:

digraph G { size="100,50" center="" ratio=All node[width=.25,hight=.375,fontsize=12,color=lightblue2,style=filled] 1 -> 3; 1 -> 17; 3 -> 15; 1 [label="Drew.DependencyAnalyser.Tests"]; 3 [label="Drew.DependencyAnalyser"]; 15 [label="Interop.WINGRAPHVIZLib"]; 17 [label="nunit.framework"]; }

This markup can be seen in the 'Dot Output' tab.

More information on Dot can be found at http://www.graphviz.org/


Download .NET Dependency Analyser

Note that you must run the WinGraphviz installer included in the archive if you do not already have it installed.


The source code for this project is freely available, so please take it and try to improve the application. Review the project issue list first. Contributors are welcomed.