IlMerge – Merge .NET Assemblies

by Svetlozar Angelov 2. February 2010 11:06

One of the reasons why I like the .NET framework is the huge amount of third party libraries in the .NET world. However, adding references to dll class libraries leads to several assemblies into your bin directory when sometimes it is more suitable to have just one exe.

Here comes the ILMerge utility. It is a tool for merging multiple .NET assemblies into a single .NET assembly.   

Here is an example how you cam merge an exe and a class library dll into one exe.

lmerge.exe /out:C:\SomePath\TheOnlyOneExe.exe 
                C:\....\bin\Debug\someexe.exe C:\....\bin\Debug\somedll.dll /t:exe

It is important to place your primary assembly (the exe in this case) as the first assembly added in order to keep the entry point. /out: stands for output file and /t: stands for target. 

Tags:

programming

Comments

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen