2

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 Compare compiled .NET assemblies?, but I need use APIs for integrated code in my custom applications, scripting and addins.

Community
  • 1
  • 1
Kiquenet
  • 14,494
  • 35
  • 148
  • 243

3 Answers3

3

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

Steve Townsend
  • 53,498
  • 9
  • 91
  • 140
  • I agree with @Steve. This isn't very difficult, so you might as well just do it yourself and maintain maximum flexibility. – Kirk Woll Sep 23 '10 at 15:05
  • @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 Sep 23 '10 at 23:32
2

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

Christian.K
  • 47,778
  • 10
  • 99
  • 143
1

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
  • 66,094
  • 13
  • 157
  • 251