How to use ILMerge?

Posted: 28/12/2013 in ASP.NET

IL Merge is a technique and a research product from Microsoft, to merge multiple DLLs and EXEs (.NET Assemblies) together to form a merged file (exe or dll). This way no separate DLL file is required.
Follow the below steps for merging an exe and dll associated with the project.

Installing ILMerge

ILMerge is not distributed with the .NET framework and so must be obtained and installed separately. The installation file can be downloaded free-of-charge from the ILMerge download page of the Microsoft web site. Once downloaded, simply double-click the file to begin the installation process and follow the instructions provided.

Download and install the ILMerge utility from Microsoft Website.
Step 1: Download ILMerge utility and install it in your machine
Step 2: Compile and Publish your Project to a folder (eg: C:\Publish\)
Step 3: Use the ilmerge command to merge the exe and dll files and output single exe file
ILMerge Command
Syntax (Simple*): ilmerge /out: /target:<dll|exe|winexe>
*For complete set of options and syntax refer ILMerge Documentation
C:\Program Files\Microsoft\ILMerge>ilmerge C:\Publish\MyProgram.exe C:\Publish\MyLibrary.dll /out:C:\Publish\MyWinApp.exe /target:winexe /ndebug

Source : Arun’s Blog


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s