What are these differences in the two dll files generated from the same source code

All my code is under source control, so I am 100% sure that the source code has not changed. But if I create the C # DLL twice, their contents are a little different. I can reproduce the problem in 100% of cases by simply building and then creating it again.

This does not affect the program at all, but tools like MSIMSP used to create patches from two MSI files are discarded by these minute changes. Creating patches (for my product) is 40 times more than it should be.

I decompiled both the DLLs and their assembly, classes, etc ... exactly the same. Files also have the same size, but, of course, have a different creation time. So I really can’t understand what has changed.

So, I dug a little deeper.

I used WinDiff to search for changes, and then cross-referenced them in a hex editor. WinDiff shows the change in the second line and in the line about 80% of the file.

In the hex editor, I see that the first byte that was changed is byte 0x088 (byte 136). This seems to be the only byte changed on this β€œline”. I find it difficult to find the second change, since WinDiff does not tell me the exact offset of the change byte.

Here is an image of the changes, the right file is the contents of the new file. Hex view

Does anyone familiar with creating (C #) DLL files know what a modified byte can mean? Or even better, how can I make sure that the .dll files remain unchanged when they are restored?

+5
source share
1 answer

This may have something to do with the differences between Build and ReBuild.

Difference between build solution, rebuild solution, and clean solution in Visual Studio?

if he does not consider it necessary to rebuild the project, he will not. It can also use partially constructed project bits if they have not changed.

The build execution uses metadata behind the scenes, and therefore your dll may be different

Why is another dll created after a clean build without code changes?

DECISION:

You will need to perform deterministic assembly as described here

+4
source

Source: https://habr.com/ru/post/1260701/


All Articles