.NET Framework Bookmark and Share   
 index > MSBuild > Reproducable MD5/SHA1 on a rebuild
 

Reproducable MD5/SHA1 on a rebuild

Hi, I'll give you a little bit of background first as to why I'm asking this question:

I am currently working as a programmer in the gambling sector and as such our code is quite strictly looked-over by official test houses. These test houses expect to be able to build the code and generate an .exe or .dll which is EXACTLY the same each and every time (without changing any code obviously!). They check the MD5 and the SHA1 of the executables that they create to ensure this.

Up until this point I have predominantly been coding in C++, where (after a few project setting tweaks) I managed to get the projects to rebuild consistantly to the same MD5/SHA1. I am now using C# in a project and am having great difficulty getting the MD5's to match after a rebuild. I am aware that there are "Time-Stamps" in the PE header of the file, and they have been cleared to 0. I am also aware that there is a GUID for the .exe, which again has been cleared to 00 00 00... etc. However the files still don't match.

Any ideas or suggestions would be most welcome!
Siyfion
Oh I forgot to add: I'm using CFF Explorer to view and edit the PE Header to remove the time and date stamps. After using a binary comparison tool there are only 2 blocks of bytes in the .exe's that are different (both very small).

One of the inconsistant blocks appears *just* before some binary code, which in ASCII details the path of the "*Project*\obj\Release\xxx.pdb" file.

The other block appears in the middle of what looks to be function names, ie. (a typical section) "AssemblyName.GetName.Version.get_Version.System.IO.Ports.SerialPort.Parity.Byte.<PrivateImplementationDetails>{" then the different code block: "4A134ACE-D6A0-461B-A47C-3A4232D90816" then followed by "}.ValueType.__StaticArrayInitTypeSize=7.$$method0x60000ab-1.RuntimeFieldHandle.InitializeArray"... etc..
Siyfion
I thought that as C# code compiles into CIL, that it would be easier to get the same results each and every time but alas, it doesn't seem so. Unless I can find a solution to this problem I wont be able to use C#, which is a bit of a bummer, to say the least!
Siyfion

You can use google to search for other answers

Custom Search

More Threads

• problem with Build from command line usind devenev.exe
• Build fails when looking for item in the Properties folder vs 2005
• How do I run programs before and after my application executes?
• MSBuild - language of progress and error messages
• Nant to MSBuild converter
• ResolveAssemblyReference task failed unexpectedly
• Using the BuildEngine object model from a task.
• How to Get a List of files in runtime?
• Environment variable in msbuild
• Unable to generate log file from MSBUILD