Merging a .NET .DLL into an .EXE with ILMerge
I am currently working a C# console application that I want to be able to easily deploy onto multiple machines. Currently, it is referencing about a half a dozen other DLL’s that I don’t want to have to deploy along with it. I really, really wanted to be able to deploy a single file via xcopy to ensure that I do not accidentally miss any of those dependancies.
ILMerge allows you to merge multiple .NET assesmblies into a single dll or executable.
Merging into a DLL
ilmerge.exe /target:library /out:newassembly.dll assembly1.dll assembly2.dll
Merging into an EXE
ilmerge.exe /target:winexe /out:newassembly.exe assembly1.exe assembly2.dll
You can find ILMerge here.




