Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

ILMerge

> 编程语言
Open source

ILMerge is a static linker for .NET Assemblies.

1.3K stars0 likes1 views
WebsiteGitHub

About

ILMerge is a static linker for .NET Assemblies.

ILMerge

ILMerge is a utility that merges multiple .NET assemblies into a single assembly. It is freely available for use and is available as a NuGet package.

If you have any problems using it, please get in touch. (mbarnett at microsoft dot com). But first try reading the documentation.

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.

ILMerge is packaged as a console application. But all of its functionality is also available programmatically.

There are several options that control the behavior of ILMerge. See the documentation that comes with the tool for details.

The current version is 3.0.29 (released on 10 April 2019). NOTE: There is no longer a version of ILMerge that runs in the v1.1 runtime.

ILMerge runs in the v4.0 .NET Runtime, but it is also able to merge assemblies from other framework versions using the /targetplatformoption. Please see the documentation. (However, it can merge PDB files only for v2 (and later) assemblies.)

Currently, ILMerge works only on Windows-based platforms. It does not yet support Rotor or Mono.

If you use ASP.NET v2.0, then it provides a tool (based on ILMerge) to combine assemblies created during precompilation. You can get more details from the ASP.NET web site.

Installation

As noted on the ilmerge NuGet page, the package can be installed from the Visual Studio environment. Expand the project container in the Solution Explorer view. Right click on references and select Manage NuGet Packages

Ensure the Package source is set to nuget.org

Next, click on Tools - NuGet Package Manager - Package Manager Console. Ensure the Package source is also set to nuget.org

To install for the project, use the Install-Package command:

Install-Package ilmerge -Version 3.0.29

Usage

MSBuild

ILMerge can be used in MSBuild using the NuGet package:

xml

  
    
  

  
    
    
  

Edit the project .csproj or .vbproj files (inside the respective .. tags, typically at the end of the file. If compiling for a specific target, use explicit directories such as Bin\x64\Release:


    
  

  
    
    
  

Although whitespace is usually ignored in XML files, in this case the exact text is processed as a DOS command, so to improve readability, use the carat ^ (shift 6) line extenders:


    
  

  
    
    
  

The DOS dir /b option can be helpful in listing all of the dependencies:

dir bin\x64\Debug\*.dll /b

From Visual Studio Developer Command Prompt:

powershell
# Download/install the package reference
msbuild /t:Restore

# Run the ILMerge target
msbuild /t:ILMerge

To run ILMerge in a batch file:

The Visual Studio Developer Command Prompt is not needed here, as msbuild is not used.

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言