views:

985

answers:

5

Are there any good programs out there to compare to compile .NET assemblies?

For example I have HelloWorld.dll (1.0.0.0) and HelloWorld.dll (2.0.0.0), and I want to compare differences how can I do this?

I know I can use .NET Reflector and use the Assembly Diff plugin. Are there any other good tools out there to do this?

+5  A: 

Two ways.

You could ILDASM and diff with classic tools.

Or you could use NDepends, which will cost for that feature.

[Piece to C# bloaters..]

rama-jka toti
+1, just ildasm both files, then diff the text output; you don't need expensive toos
Paul Betts
I love easy solutions like this.
Tom Resing
+8  A: 

Ways to Compare .NET Assemblies suggests

Commercial:

Free:

Daniel LeCheminant
Just a note that Framework Design Studio is pretty useless. More like a book pusher that teaches the style and then eventually we all realise those guidelines are not the answer to anything. Reflector addin is about the only one that is free and good but under-developed.
rama-jka toti
I've spent 20 minutes today trying to use the reflector add in and I don't think that it works. I tried comparing 2 assemblies that were named the same thing in 2 different directories.
jcollum
A: 

Java has a nice one: http://stackoverflow.com/questions/523307/semantic-diff-utilities/

Jonathan Parker
Interesting, but not relevant
Tom Resing
+3  A: 

I just had to compare two revisions of the same DLL, which had the same version (I needed to implement a small hotfix, and deploy the DLL in production, but I wanted to make sure that no other changes leaked into code). Ideally, I would want the Assemby Diff add-in to show me the difference, but it does not work (it thinks that I'm comparing a DLL to itself). So this is what I did:

  • Created two folders to hold disassembled source files.
  • Used the Reflector's Export option (from context menu) to generate source files from each DLL in the folders created in previous step.
  • Used the free DiffMerge tool to compare two directories; the tools showed me the modified files and the difference.

It's a bit kludgy, but seems to work. I wish the Assembly Diff add-in worked, though.

Alek Davis
WindDiff that comes with Visual Studio is effective too.
Tom Resing
I assume you meant the WinDiff (one 'd') utility. It's OK, but DiffMerge is so much nicer.
Alek Davis
+1  A: 

NDepend is really what you need to compare compiled .NET assemblies:

Step1: ask for changes (here ask for methods where code was changed or was added) alt text

Step2: compare source code method bodies (if you have PDB files and source code),

Step2 Bis: compare 2 versions of the IL code of a method within one click (NDepend will use automation on Reflector for that). alt text

Patrick Smacchia - NDepend dev