IL Merge utility from MS Research


This can be an interesting tool (haven’t tried it myself yet, but will do so soon).

ILMerge takes a set of input assemblies and merges them into one target assembly. The first assembly in the list of input assemblies is the primary assembly. When the primary assembly is an executable, then the target assembly is created as an executable with the same entry point as the primary assembly. Also, if the primary assembly has a strong name, and a .snk file is provided, then the target assembly is re-signed with the specified key so that it also has a strong name.

Immediatly as I saw this, I was thinking about my own little pet project that is a simple utility, but due to its design is split into multiple projects in VS.NET and as such generates some dll’s and an exe. But it would be nicer to just have all the code in 1 single .exe. Makes web-deployment and such easier. I know that I could put all of the source files in one ‘build’ project and achieve the same result, but this is a nice alternative.

Comments (3)

  1. Luc Cluitmans says:

    Since I discovered ILMerge half a year ago I have been using it a lot. Probably the VS2005 link.exe will make it mostly superfluous (as Junfeng mentions), but I definitely prefer ‘Copy deployment’ over ‘XCopy deployment’, and I can use ILMerge to achieve a similar effect right now.

    Also, ILMerge seems to let some ‘air’ out of the executables and DLLs: An ILMerged file is typically smaller than the sum of its components, especially when the components were small to start with.

  2. Mario Goebbels says:

    VS2005 link.exe doesn’t support full assembly linking tho, which would be a help considering I have 3rd party components but want a monolithic executable.

    And why is it link.exe but not AL.exe?