0

Following the idea of this question:

Is there a way to compare two .NET .dlls from the point of view of the CLI instructions and native instructions, to ensure that they are exactly the same, mean will behave exactly the same at runtime?

Typical use case is: you want to ensure that you have a reproducible build environment: that all developer machines compile exactly the same code as the build server.

The hash of the .dll file is not sufficient as the .NET compiler doesn't guarantee two identical .dlls are produced when compiling the same source code twice (and effectively changes a few bytes at the top and at the tail of the dll).

This question is similar to this former one, but the question didn't focus on the functional/behavior aspects of the .dlls, resulting in unclear answers and confused conversation.

Community
  • 1
  • 1
jeromerg
  • 2,997
  • 2
  • 26
  • 36

1 Answers1

1

One possible way could be to write unit tests. But not sure if it will also cover the statement:

from the point of view of the CLI instructions and native instructions

Yahya
  • 3,386
  • 3
  • 22
  • 40
  • I fear that unit test will not really help you: changes in compilation are not necessarily visible to unit test like: code refactoring, framework version change, compiler settings change – jeromerg Sep 08 '15 at 15:13
  • @jeromerg `mean will behave exactly the same at runtime?` Unit tests will ensure this statement. And also that they are `functionally` same. – Yahya Sep 08 '15 at 15:16