ISSUE :
 
Profile photo
Submitted by Matt Hunker
on July 19th, 2011 at 12:41:22 EST

Can I merge .exe and dll into one single executable file?

I have windows .NET application with .exe which uses other .dll files. And I need to redistribute this .exe and .dlls files. and it will be nice if I can combine all .exe and .dll into one single .exe. Is there any way in .NET that I can combine multiple .exe and .dll files into single executable file?


Profile photo
Replied by RaKumar
on July 19th, 2011 at 15:29:57 EST
You can use Microsoft free tool called ILMerge.exe. This is free tool by Microsoft for the specific purpose as you have described to merge .exe and .dll into single exe or dll file.

You can download ILMerge tool from Microsoft site:
http://www.microsoft.com/download/en/details.aspx?id=17630

After downloading, install this tool and read the documentation file for vaious switches to run the tool. This is console tool.

Sample example:
ilmerge /t:winexe /out:merged.exe /targetplatform:v4,C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 MyExeFile.exe ClassLibrary1.dll

Accepted Answer
Accepted
 Answer

Profile photo
Replied by Matt Hunker
on July 20th, 2011 at 07:44:45 EST
Thanks. This is exactly what I am looking for. ILMerge work as expected. I wonder why this is not part of .NET framework?

Profile photo
Replied by Kai Film
on March 9th, 2012 at 15:04:02 EST
I just came across of the same issues but for unmanaged code and have found freeware files virtualization solution Enigma Virtual Box at http://enigmaprotector.com/

It can merge with exe both managed and unmanaged dll files.