views:

74

answers:

4

I would like to compare several dlls of one install to several dlls of another install of the application I'm working with. I need to ensure they are exact same. How do I compare two dlls to ensure they have the exact same methods, properties, version, etc?

I've started to use RedGate .Net Reflector, but the task became tedious so I thought I'd give SO a shot, see if anyone else has been in my situation before and has a quick solution.

Thank you!

+3  A: 

I'm assuming that you can't rely on the assembly versioning to answer this.

A quick search on google turned up this post by Scott Hanselman that points to several tools that may solve your problem.

confusedGeek
The SN of an assembly doesn't implicitly contain ABI information :-/
pst
Yes I realize that, the fact that the OP needs to compare two assemblies together indicates their are some version management problems.
confusedGeek
Yes, the versioning of the assemblies was never updated for two releases, so I'm trying to help some customers find what version they are on.
Eric U.
Scott Hanselman plugin for dotnet reflector is helpful, but not as automated as I was hoping :)
Eric U.
+1  A: 

Edit: For non-programmatic determination hints, see confusedGeeks answer :-)

I would use a SN assembly to determine the "version", then;

If the ABI is not reflected in the version, perform a secondary md5sum against the files or perform a reflective compare of the two assemblies. The md5sum would of course "catch" internal/compilation changes even if the ABI didn't change. Reflecting the ABI, while more complicated and potentially dog-slow, could determine ABI changes spot-on.

It might just be easiest and sufficient to just "overwrite" any assembly with the same version (and let previous/later versions remain until removed by whomever put them in place).

pst
is a md5sum enough to validate that they are the same? Since I'm comparing a versioned assembly with a assembly that does not have the version stamp... wouldn't that change the md5sum between the two?
Eric U.
@Eric Unless you are worried about some very, very clever NIHM hackers trying to steal your cheese, the md5sum can be used reliably: different md5 sums -> different file contents.
pst
A: 

I use WinMerge all the time to do this task. You can even compare entire directories. This is of course if you just need to know if they're the same, since it won't show you any code.

Arturo Molina
+2  A: 

Why not use Dependency Walker? Copy all the exported functions into a text file. Repeat the same with the other DLL. Then diff the two text files.

I did that once to solve error 127, which said it couldn't load the DLL because an 'unknown' dependency was missing.

C Johnson