DepGraph is a tool which generates a PNG image showing a build dependency graph of a project in Visual Studio. Is uses the graphviz tools from here. The picture above shows the generated dependency graph of one of my solutions. It uses the similar ideas as in Dependency-Grapher for C++ Projects by SteveKing.
- Install graphviz from here.
- Copy compiled executable to some folder.
- Enjoy to use!
I have developed a large program in C++, in command of many developers. These people produce too many modules, which realize different functionality. Many modules (usually Static C++ or Dynamic libraries) use other modules. For compiling the result, it is necessary to set the correct build dependencies. The problem is that VS has a trouble with incorrect or ring dependencies. It results in producing too many warning messages about symbols' multiple definition. Some amount of these messages can appreciably increase compile time. And more over, incorrect dependencies can crash the linker to internal error! Controlling and supporting dependencies by hands is difficult. This tool will help you (I hope) to solve your problems in solutions with many-many separate projects. And will provide some information about the cause of troubles, if you meet them.
To use this tool, make the following:
- Run Visual Studio.
- Open solution whose project dependencies you want to display.
- Just run the tool without any parameters.
Program makes the following:
- Determines that Visual Studio is running.
- Determines which solution is currently open in VS, and directory where sln file is located.
- Generates a Build dependency graph in the same directory as the sln file. Name of this file will be solution_dep.png.
Please note that the picture files may become really huge for solutions with many projects!
Note: In the same directory as the solution file can be a file with name depExcl.txt. In this file, you can specify names of the project (one per line, case insensitive) dependencies which must not be displayed. It's useful for frequently used projects, from which depends many other projects, for entity link decrease. Projects listed in this file will be displayed on the diagram in a different color. (See project versionInfo on picture above.) This file can contain comments (lines beginning aith '#'). Here is an example of depExcl.txt.
#Project2 Here is a comment!
There are a lot of improvements possible like a better ordering of the dependency graph and the like. Some of you might find the colors awful - feel free to change that . Also, I think it's a good idea to make this tool as a plug-in for Visual Studio. I you find some mistakes - please do not beat me with rocks, it is my second C# program (first of it is "Hello world!") .
Points of Interest
Ho! I like to listen to Metal music while coding!
September 29 2004 - Initial release.