Dump References VS add-in
In our current products we have to deal with very big build projects, some of are divided in more than 200 libraries. This poses huge challenges on the build process and their overall management.
On Windows we build everything with Visual Studio and msbuild, however I have often stumbled upon two very annoying quirks in them:
- If you build a Solution through msbuild and project A in it depends on another project B that is NOT in that solution, project B will be compiled and linked in it’s default configuration. Usually this is the Debug configuration. This might lead to some Debug libraries being linked in a Release project or some other config inconsistency.
- If project A in a solution references project B, also in the solution, then Visual Studio fails any compilation attempt with the cryptic “The project file ‘ ‘ has been renamed or is no longer in the solution.” giving no actual info on what’s wrong. There is a bug on MSDN about this. It’s unclear if and when it’ll be fixed and most solutions suggested by users involve removing all projects, adding them one-by-one and testing which one fails. This is unfeasible in large solutions.
The second problem was for us very serious. We use premake to generate our projects on different platforms and often change dependencies, upgrade third party libraries etc. GUIDs however are only used in VS projects and they keep getting out-of sync often.
We knew we needed an automatic way to check those issues. One solution would have been a program that just walks and parses all VS projects and issues the warnings we are interested in. I opted however to create a VS add-in because the data we are interested in is already readily parsed and available in the IDE itself.
Dump References Add-In
Dump References is an add-in for Visual Studio that prints the references of all projects loaded in the solution, checks their GUIDs and prints eventual issues. It is intended for C/C++ solutions.
The add-in is fairly simple – it walks all projects in the solution and their references and prints:
– all projects currently in the solution
– all references that each project has
– all unique references in the solution
– possible issues: referenced projects missing from the solution; projects available in the solution but referenced by other projects with another GUID.
To dump the diagnostic just right-click on your solution in the Solution Explorer and click “Dump References”.
The results will be available in the Output window in the Dump References pane.
The add-in’s source is available on GitHub and licensed under the MIT license, so feel free to use it.
Follow Stoyan on Twitter: @stoyannk