Why is a different dll produced after a clean build, with no code changes?

后端 未结 3 1140
滥情空心
滥情空心 2020-12-06 10:40

When I do a clean build my C# project, the produced dll is different then the previously built one (which I saved separately). No code changes were made, just clean and rebu

相关标签:
3条回答
  • 2020-12-06 10:41

    I think that would be the TimeDateStamp field in the IMAGE_FILE_HEADER header of the PE32 specifications.

    0 讨论(0)
  • 2020-12-06 10:54

    Could be that the build or revision numbers have changed.

    0 讨论(0)
  • 2020-12-06 10:55

    My best guess would be the changed bytes you're seeing are the internally-used metadata columns that are automatically generated at build-time.

    Some of the Ecma-335 Partition II (CLI Specification Metadata Definition) columns that can change per-build, even if the source code doesn't change at all:

    • Module.Mvid: A build-time-generated GUID. Always changes, every build.
    • AssemblyRef.HashValue: Could change if you're referencing another assembly that has also been rebuilt since the old build.

    If this really, really bothers you, my best tip on finding out exactly what is changing would be to diff the actual metadata tables. The way to get these is to use the ildasm MetaInfo window:

    View > MetaInfo > Raw:Header,Schema,Rows // important, otherwise you get very basic info from the next step
    
    View > MetaInfo > Show!
    
    0 讨论(0)
提交回复
热议问题