I am comparing to make sure 2 dlls are generated from same source. As I could not use external tools to compare, I just created IL files using IL disassembler and comparing manually.
For the below fields in a .IL file , the count is same while comparing.
// CLR method headers : // Num.of method bodies - // Num.of fat headers - // Num.of tiny headers - // Managed code : // Ave method size -
Order of class names are not same while count and names are same .
Is it safe to assume for the above scenarios that both DLLs are from same source code?
There's no way to tell this.
Not only are no two compiled DLL's the same because of the MVID and other properties that differ each time you compile: two assemblies containing the same number of methods doesn't tell anything:
Foo()
method containsreturn true
, while v2'sFoo()
containsreturn false
)It seems like you have an entirely different problem you want to solve, like educating your team and using continuous integration to share assemblies that are compiled on a build server. If you can explain why you want to make sure two DLLs were compiled from the same source, perhaps some better answers can be given.