Comparing CLI assemblies using NDepend

LatelyI had following task to deal with. Had two assemblies, an older and a newer version of the same dll. But no source code for any of them. I had to assess the differences between this two assemblies. “How to do it efficiently?” I asked myself. The easiest way as it seemed was to open both in Just Decompile (or any other reverse engineering tool for .NET) and go through them. But, while I was writing my “Continuous Integration in .NET” book, I was lucky enough to get a free license of the NDepend tool from Patrick Smacchia. NDepend is mainly code analysis tool for .NET. It is able to check the best practices using SQL like language CQL (Code Query Language). In last version v4 the CQL can be written in Linq! But I was interested in the assembly comparison functionality. Here is how I used it.
Start Visual NDepend and choose “Choose Assemblies or Analysis to Compare” from Compare menu.

Choose the dlls you want to compare (as a demonstration I’ve used System.Web):

After running the analysis you will be presented with the HTML site containing the summary report. I found the Interactive UI Graph the most useful when comparing the functionalities from both dlls. You can run it from this dialog:

The class browser contains the compared classes. The bold ones are the ones added in the newer version and the underlined are those changed. What else does a lost developer need!

Leave a Reply

Your email address will not be published. Required fields are marked *