How can I copy .NET assemblies?

If I compile a C # project twice, I will get two assemblies. These assemblies are not exactly the same (using binary diff). I can think of the reasons why this is so, but the fact remains: the source for the two assemblies is identical.

I am interested in creating a patch between these assemblies and applying the patch on a client machine.

Does anyone know a library (preferably .NET) or a tool with which I can create and apply fixes?

Ideally, it should also handle small changes, such as changing dependencies at the project level or setting up multiple lines in the source. This should not be able to handle the big changes, because I am happy to completely replace the assemblies in this case.

Update

I think a little more background can help clarify what I get. I have a continuous integration server creating my application. I am changing the version of the file and the assembly to reflect the assembly number and the version I am creating. I could have done it differently, but this is an option that I like.

This causes the assembly links to change when I create my application, but I'm happy with that. Now I'm interested in distributing an update for a previously released version. I create updates using InstallShield. The fees available for InstallShield are reduced to small patches. This does not increase the size of the update by much.

My application has several data files, which are mostly encrypted archives containing assemblies. InstallShield does not have access to these assemblies or to understand my archive. He does not know how to decrypt and extract it. I wrote my own repair procedure, which finds the modified files in the previous archive and replaces them with a new updated version. Mostly a search and replace strategy.

One archive contains almost a hundred (and growing) of these assemblies, and some of these assemblies contain large data files as resources. These assemblies depend on the assemblies that are part of the application. They also assemble during continuous integration. Without compiling them during build, you will leave room for dependency problems, and I don't want to try to do this. Every time I create a patch, all these assemblies are included. Now I am looking at options for reducing the size of the patch, creating patches for these assemblies.

+4
source share
2 answers

This is not .net, but it should be able to generate a patch file for you -

http://www.tibed.net/vpatch/

I used it for games and maps etc but it should work with any two files.

+3
source

I would recommend replacing your builds. Patching has always been problematic - at least compared to replacing. Assembly files are usually quite small, so replacing them is usually not a very big task.

Typically, the reason the assemblies change if the source is identical usually relates to one of several things. Your project may have changes, but most likely one of the assemblies associated with the assembly has changed. In this case, you will need to distribute the full set of assemblies, including the referenced assembly, or you will get version problems and breakdowns on client machines.

Creating a new installable file is usually much easier and safer than trying to fix the machine in place.

+12
source

All Articles