Reputation: 90603
I presume that if the C# code is unchanged, the generated IL will be the same each build. The problem is that 2 EXE files generated from the same code don't have the same hash.
I would like to check whether a change in code style generates a different IL. How can I achieve that?
Upvotes: 3
Views: 608
Reputation: 3120
There are some tools you can use to disassemble the EXE and compare their content. Look at this blog http://immitev.blogspot.com.br/2008/10/ways-to-compare-net-assemblies.html
[]'s
Upvotes: 1
Reputation: 171589
You can do this with ILSpy, an open-source .NET assembly browser and decompiler.
Upvotes: 1
Reputation: 17818
You are making a bad assumption. A rebuild without code change will deliver a different binary.
See:
https://stackoverflow.com/a/8927785/426894
Every time you run the compiler you should get a different output.
And
Is compiling the same C# program twice guaranteed to produce the same binary output?
No.
Upvotes: 4