How to use ILMerge?

Posted: 28/12/2013 in ASP.NET
Tags:

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
http://www.microsoft.com/en-us/download/details.aspx?id=17630
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
Example:
 
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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s