开发者

How do I compare the contents of two dlls?

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 b开发者_运维问答een in my situation before and has a quick solution.

Thank you!


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.


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.


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.


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜