28

Does anyone know a decent tool that will compare two different versions of the same dll and extract the differences?

thanks

flesh
  • 23,725
  • 24
  • 80
  • 97

6 Answers6

34

dotPeek from JetBrains can also be used. It is also free.

  • Open the assembly up in dotPeek
  • Select the assembly
  • File --> Export to project
  • Choose a location on disk

Repeat the above for the assembly you want to compare, then open the two folders in a diff tool. I used WinMerge.

You'll notice that the vast majority of files have differences. This is because the files have a comment at the top like this

// MVID: {some guid here}

or

// Assembly location: {some path here}

You can create a filter in WinMerge to ignore it

  • Tools --> Filter...
  • Goto the "Line Filters" tab
  • Add the following filter ^// MVID:
  • Add the following filter (optional) ^// Assembly location:
  • Check the checkbox next to your new Regular Expression
  • Check the "Enable Line Filters" checkbox

When you okay the changes, it will rescan the folders and ignore any line that starts with that comment. Now you should see just the changes you're interested in.

Walter Stabosz
  • 7,447
  • 5
  • 43
  • 75
Colin Mackay
  • 18,736
  • 7
  • 61
  • 88
  • 6
    This one works great and is totally free. You might need to add more filters though. I had to add `^// Assembly location:` as well. Thanks Colin – mariozski Mar 07 '14 at 11:05
  • 2
    Also, be sure to click the "Enable Line Filters" checkbox option, in the LineFilters tab. I missed it, originally, and spent ten minutes scratching my head. – Jason Marsell Nov 18 '16 at 02:25
16

Reflector has a Diff tool. Note: Reflector is now paid software.

Note: the Diff tool is not available anymore. You can still download it via Softpedia and use it with older versions of Reflector (from around 2010). On later versions it doesn't work anymore.

Abel
  • 56,041
  • 24
  • 146
  • 247
Andrew Hare
  • 344,730
  • 71
  • 640
  • 635
  • Does this still work with latest Reflector version? Mine just crashed doing a diff. – mkmurray Apr 12 '10 at 19:36
  • I couldn't get this to work with the latest version (6.5), which is too bad because it sounded great. – theChrisKent Dec 17 '10 at 20:28
  • 4
    As Reflector is now a paid software, any one know an alternative? Not that i don't want to open my wallet, but looking for alternatives which can do diff and disassemble. Update: Just found out that Telerik has a disassembler which is pretty great. Telerik Disassembler. You need an account(free) created to download though. Disassemble, export and compare. – lakshminb7 Jan 26 '12 at 17:32
  • The Diff plugin somewhat works great with the current paid version of Reflector. There are a lot of places where it says stuff changed when it didn't. – Jonathan Allen Oct 15 '13 at 21:32
  • 4
    The link doesn't work anymore. – Ankur-m Sep 24 '14 at 11:20
  • my reflector crashed when I tried the reflector Diff tool – hamish Jul 14 '16 at 09:59
4

Use .NET Reflector (Free version is all you need) to open the dlls then right-click and choose to export them to separate directories.

Then use ExamDiff Pro to compare the directories (You can get a 30-Day free trial). You can navigate through the sub folders and open each file as necessary into a new Comparison window (Just double-click in the ExamDiff Pro Window). Works awesome!

ExamDiff Pro also has a Dump PE32 plugin that will do a comparison directly between .dll and .exe files. This is helpful to look at header changes and flags binary differences, but will not decompile it for you (so use the Reflector method above).

theChrisKent
  • 15,029
  • 3
  • 61
  • 62
  • nah it doesn't work. i can see the code in reflector just fine. but exporting gives 134 error(s). Done. – hamish Jul 14 '16 at 10:12
4

Why not disassemble first and then compare?

sharptooth
  • 167,383
  • 100
  • 513
  • 979
4

Check http://www.red-gate.com/products/reflector/

Gad
  • 41,526
  • 13
  • 54
  • 78
0

The Microsoft BCL team have a tool do to this, it's called LibCheck and can be found here

http://blogs.msdn.com/b/bclteam/archive/2005/03/21/400123.aspx

This is an old tool, and I had to recompile the source using a later version of the runtime, but it works well and provide html reports on changes.

benthemos
  • 195
  • 6