(this answer has been edited to update links to new download locations and reflect new ideas)
Best to use Micorosoft ILMerge . It was used as a separate download from Microsoft Research (it is not part of the VS or .NET SDK).
The original version was supported until 2012. Now this is the NuGet Package , which is the best way to get it now, and add it to your project and create a server.
Alternatively, you can try the ILMerge GUI from CodePlex, which provides a GUI interface for ILMerge. Its development was interrupted, but now it is again active.
A Codeproject article on ILMerge explains more about how to use it and explains some use cases. Command example:
ilmerge /target:winexe /out:AllInOne.exe NormalProgram.exe Lib1.dll Lib2.dll
Alternatively, you can use Fody with Costura.Fody as described in this SO answer .
Note (1): if you need to combine side-by-side assemblies (i.e. mix your own 64-bit and 32-bit assemblies), you should consult this SO article on loading side-by-side assemblies dynamically .
Note (2): to add this as an integral step in the assembly process, simply go to "Project Properties"> "Assembly Events"> click "Edit Post-Assembly" and fill out the command above. Click Macros to see how to link to the current file or assembly.
source share