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.
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:
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.
Select which assemblies you want to include in the plot and press OK.
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.
Here's an example of the SVG output.
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:
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.