ILRepack.Lib.MSBuild.Task 2.0.25

There is a newer version of this package available.
See the version list below for details.
dotnet add package ILRepack.Lib.MSBuild.Task --version 2.0.25
NuGet\Install-Package ILRepack.Lib.MSBuild.Task -Version 2.0.25
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.25" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ILRepack.Lib.MSBuild.Task --version 2.0.25
#r "nuget: ILRepack.Lib.MSBuild.Task, 2.0.25"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ILRepack.Lib.MSBuild.Task as a Cake Addin
#addin nuget:?package=ILRepack.Lib.MSBuild.Task&version=2.0.25

// Install ILRepack.Lib.MSBuild.Task as a Cake Tool
#tool nuget:?package=ILRepack.Lib.MSBuild.Task&version=2.0.25

ILRepack.Lib.MSBuild.Task

MSBuild task for ILRepack which is an open-source alternative to ILMerge.

Install via NuGet NuGet NuGet

  Install-Package ILRepack.Lib.MSBuild.Task

Supported build tools

  • MSBuild

Usage

You just need to install NuGet package to merge all your project dependencies. If you want to customize the process then you can create a file named "ILRepack.targets" in your project folder. You can create it like shown below.

Example "ILRepack.targets"

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    
    <Target Name="ILRepacker" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'">
        <ItemGroup>
            <InputAssemblies Include="$(OutputPath)\ExampleAssemblyToMerge1.dll" />
            <InputAssemblies Include="$(OutputPath)\ExampleAssemblyToMerge2.dll" />
            <InputAssemblies Include="$(OutputPath)\ExampleAssemblyToMerge3.dll" />
        </ItemGroup>
    
        <ItemGroup>
            
            <DoNotInternalizeAssemblies Include="ExampleAssemblyToMerge3" />
        </ItemGroup>
    
        <ILRepack
            Parallel="true"
            Internalize="true"
            InternalizeExclude="@(DoNotInternalizeAssemblies)"
            InputAssemblies="@(InputAssemblies)"
            TargetKind="Dll"
            OutputFile="$(OutputPath)\$(AssemblyName).dll"
        />
    </Target>
    
</Project>

Configuration

You need to create "ILRepack.Config.props" file in your project folder to configure the behavior of ILRepack.Lib.MSBuild.Task.

<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
  </PropertyGroup>
</Project>

You can specify following options inside the <PropertyGroup> element to configure the behavior of the ILRepack task.

Specify your custom Targets file path

If you don't want to add "ILRepack.targets" file in your project folder then you can specify your targets file path as shown below.

<ILRepackTargetsFile>$(SolutionDir)ILRepack.targets</ILRepackTargetsFile>

Specify Key File to use for signing

You can specify the path of the SNK file you want to use for signing your assembly as shown below. This configuration option only applies if you are using default targets file provided in NuGet package.

<KeyFile>$(ProjectDir)ILRepack.snk</KeyFile>

Specify whether to clear directory after merging

If you are using default targets file then you may notice that it clears Output directory after merging dependencies. You can turn this functionality off by setting ClearOutputDirectory to False as shown below.

<ClearOutputDirectory>False</ClearOutputDirectory>

Task options

Option Description
KeyFile Specifies a key file to sign the output assembly.
KeyContainer Specifies a key container to use.
LogFile Specifies a log file to output log information.
Union Merges types with identical names into one.
DebugInfo Enable/disable symbol file generation.
AttributeFile Take assembly attributes from the given assembly file.
CopyAttributes Copy assembly attributes.
AllowMultiple Allows multiple attributes (if type allows).
TargetKind Target assembly kind (Exe|Dll|WinExe|SameAsPrimaryAssembly)
TargetPlatformVersion Target platform (v1, v1.1, v2, v4 supported).
TargetPlatformDirectory Path of Directory where the target platform is located.
XmlDocumentation Merge assembly XML documentation.
LibraryPath List of paths to use as "include directories" when attempting to merge assemblies.
Internalize Set all types but the ones from the first assembly 'internal'.
RenameInternalized Rename all internalized types (to be used when Internalize is enabled).
InternalizeExclude If Internalize is set to true, any which match these regular expressions will not be internalized. If Internalize is false, then this property is ignored.
OutputFile Output name for the merged assembly.
InputAssemblies List of assemblies that will be merged.
DelaySign Set the key file, but don't sign the assembly.
AllowDuplicateResources Allows duplicating resources in the output assembly.
AllowedDuplicateNamespaces Allows the specified namespaces from being duplicated into input assemblies. Multiple namespaces are delimited by ",".
ZeroPeKind Allows assemblies with Zero PeKind (but obviously only IL will get merged).
Parallel Use as many CPUs as possible to merge the assemblies.
PauseBeforeExit Pause execution once completed (good for debugging).
Verbose Additional debug information during the merge that will be outputted to LogFile.
NoRepackRes Does not add the embedded resource 'ILRepack.List' with all merged assembly names.
Wildcards Allows (and resolves) file wildcards (e.g., *.dll) in input assemblies.
RepackDropAttribute Name of an attribute (optional). Members in input assemblies marked with this attribute will be dropped during merging.
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on ILRepack.Lib.MSBuild.Task:

Package Downloads
Krypton.Toolkit.Suite.Extended.Software.Updater.Nightly

An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 6 - 9. This package implements software updating features. This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 6 - 9. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md

Krypton.Toolkit.Suite.Extended.Software.Updater.Canary

An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements software updating features. This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md

Krypton.Toolkit.Suite.Extended.Software.Updater

An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements software updating features. This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md

HuajiTech.CoolQ.Packing.ILRepack

使用 ILRepack 打包 HuajiTech.CoolQ 应用。

ILRepack.Lib.NET

Modified original ILRepack by changing functionality for using ModuleDefinitions instead of file names to repack assemblies.

GitHub repositories (12)

Showing the top 5 popular GitHub repositories that depend on ILRepack.Lib.MSBuild.Task:

Repository Stars
wmjordan/PDFPatcher
PDF补丁丁——PDF工具箱,可以编辑书签、剪裁旋转页面、解除限制、提取或合并文档,探查文档结构,提取图片、转成图片等等
quasar/Quasar
Remote Administration Tool for Windows
ManlyMarco/RuntimeUnityEditor
In-game inspector and debugging tools for applications made with Unity3D game engine
sailro/EscapeFromTarkov-Trainer
Escape from Tarkov (EFT) Trainer - Internal
DirtyRacer1337/Jellyfin.Plugin.PhoenixAdult
Jellyfin/Emby Metadata Provider for videos from multiple adult sites
Version Downloads Last updated
2.0.31 275 4/23/2024
2.0.29 1,525 4/1/2024
2.0.26 11,114 1/11/2024
2.0.25 716 1/8/2024
2.0.22 553 1/4/2024
2.0.18.2 206,858 11/13/2020
2.0.18.1 61,980 4/21/2020
2.0.18 89,598 10/6/2019
2.0.17 8,815 7/18/2019
2.0.16.1 78,716 2/22/2019
2.0.16 22,484 9/8/2018
2.0.15.5 18,582 6/26/2018
2.0.15.4 31,384 3/21/2018
2.0.15.3 16,421 2/21/2018
2.0.15.2 1,448 12/24/2017
2.0.15.1 1,093 12/20/2017
2.0.15 1,078 12/19/2017
2.0.13 49,925 5/1/2017
2.0.12 1,622 12/21/2016