Marko Apfel

EAI, BizTalk, SQL Server, C#

  Home  |   Contact  |   Syndication    |   Login
  62 Posts | 2 Stories | 22 Comments | 4 Trackbacks

News



Article Categories

Archives

Post Categories

BizTalk

C#

Enterprise Library

SAP

SQL Server

Technologie

Offen also a simple application references some other assemblies. In those cases for a deployment all of these assemblies are needed. Instead giving the customer a bunch of all, with ILMerge you can bundle all assemblies in one.

To support the merge-process in a post built step in my solution tree is a folder named Build which contains tools for the build-process. One of these tools is ILMerge:

Next thing we need is a simple batch (ILMerge.bat) in the project which calls ILMerge:

The ILMerge call is simple. First we copy the original AedSicad.UT.Application.Egm.Replication.exe to a temp.exe, because we want have the new bundled EXE under the same name. Then we use ILMerge to build the bundle. In a last step the temp.exe should be deleted:

   1: ECHO parameter=%1
   2: CD %1
   3: COPY AedSicad.UT.Application.Egm.Replication.exe temp.exe
   4: ..\..\Build\ILMerge\ILMerge.exe /out:AedSicad.UT.Application.Egm.Replication.exe temp.exe AedSicad.UT.Application.Egm.Replication.Engine.dll EsriDE.ArcGIS.Commons.Logging.dll log4net.dll
   5: DEL temp.exe

The last step is the post build command:

   1: $(ProjectDir)ILMerge.bat $(OutDir)

The result is AedSicad.UT.Application.Egm.Replication.exe which contains all referenced assemblies. In this case the log4net assembly and an own wrapper for logging-stuff.

posted on Saturday, November 01, 2008 11:47 AM

Feedback

# re: Using ILMerge in a post build step 10/27/2009 7:24 PM links of london Necklace
It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again. `````

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: