Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
268 views
in Technique[技术] by (71.8m points)

c# - comparing products of builds in release

I need to compare build outputs of VS2005 in order to be sure I can reproduce the exact same product.

when I do two builds one after the other in release and compare the produced files I get different files, doing text comparison it seems that more than just the datetime is different

how can I build in order to reproduce exact same product each time ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Whenever you build, the compiler embeds:

  • The date and time
  • A GUID (used for debugging etc, I believe)
  • Potentially the assembly version (which may have "1.2.3.*" and populated automatically)
  • Potentially a strong hash

A couple of options:

  • Find out where the files are "known to differ immaterially", wipe those bytes, and then compare
  • Use ildasm to convert the assemblies to text, and then compare those results. (I haven't checked whether or not this reveals the differences too - it may do, in which case again you'd have to explicitly ignore certain sections)

This problem does pop up every so often, so I'll see if I can come up with a tool to do the comparisons - although it's unlikely to cope with signed assemblies, as the location of the signature could vary significantly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...