views:

49

answers:

3

For example I have Assembly1.dll (1.0.0.0) and Assembly1.dll (1.0.0.0), in differents folders and I want to compare differences (if each assembly has the same Classes and each class the same methods, or compare all MSIL code). any APIs for do this?

There are tools, like this http://stackoverflow.com/questions/652432/compare-compiled-net-assemblies, but I need use APIs for integrated code in my custom applications, scripting and addins.

+2  A: 

If you want an API and not a canned tool, why not use System.Reflection to construct the API that you need?

Steve Townsend
I agree with @Steve. This isn't very difficult, so you might as well just do it yourself and maintain maximum flexibility.
Kirk Woll
using reflection can I compare MSIL code ??
alhambraeidos
@alhambraeidos - MSIL is only available in a limited way - see here: http://stackoverflow.com/questions/2693881/c-can-i-use-reflection-to-inspect-the-code-in-a-method for details
Steve Townsend
+1  A: 

If you need to do detailed comparisons down to the content of methods, you can use the FxCop API (which is normally used to write FxCop rules). It uses an introspection model that is much richer than reflection.

Wim Coenen
+1  A: 

You could also checkout Mono.Cecil. (it is the library internally used by other tools like NDepend).

Christian.K