Csc.exe编译来自相同.cs的“不同”.dll

时间:2013-03-15 16:11:10

标签: c# msbuild diff csc binary-reproducibility

提供一个源.cs文件,如下所示,有没有办法用MSBuild(或至少用csc.exe)生成相同的.dll,所以它们的二进制哈希匹配?

foo.cs

public class Foo
{
    public int Bar;
}

foo.bat

del foo*.dll

csc /t:library foo.cs
move foo.dll foo1.dll

csc /t:library foo.cs
move foo.dll foo2.dll

powershell -Command "Get-ChildItem foo*.dll | ForEach-Object { $_.CreationTime = $_.LastWriteTime = $_.LastAccessTime = \"2013-03-15\" }"

示例二进制差异报告位于https://dl.dropbox.com/u/65419748/CscBin.html

有谁知道这些差异是什么以及如何绕过它们?

0 个答案:

没有答案