Search code examples
c#hashbinary-reproducibility

Why does C# generate different EXEs for the same source-code?


Every time we recompile our C# application we end up with EXEs with different MD5 signatures. We are recompiling on the same machine, minutes apart. Why doesn't the same source-code yield the same output? Is there a way to fix this?


Solution

  • "So every assembly has:

    1. A Timestamp, in two locations
    2. A GUID that matched the PDB
    3. What appears to be a completely random GUID generated every compile.
    4. A counter indicating what the build of the assembly is - generated only in subsequent Visual Studio builds."

    from:

    http://ritter.vg/#code_adventures_clr1