Skip to content

smklancher/MSBuild.ILMerge.Task.SMK

Repository files navigation

MSBuild.ILMerge.Task

This was forked from the original to get it to work with PackageReference packages in SDK style projects, and later to work properly with nuget packages that contain reference assemblies.

This fork is not on nuget (and is still using the original package name), so to use it:

  • Build project to product nuget package, move elsewhere if needed.
  • Add nuget.config to solution folder with folder updated to where you will keep the nuget package.
  • Update project to new reference

nuget.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="MyLocalSharedSource" value="..\..\..\some\folder" />
    </packageSources>
</configuration>

Forked from https://dev.azure.com/Refactorius/MsBuild.ILMerge.Task 2021-03-07.

Original - MSBuild.ILMerge.Task

MSBuild ILMerge task allows you to use the famous ILMerge utility in automated builds and/or Visual Studio 2013/2015/2017 projects.

It is similar to the ILMerge.MSBuild.Tasks nuget package, originally published by [email protected] (that seems to be abandoned) with the following additional features:

  • It supports all the latest ILMerge options;
  • ILMerge.exe is discovered as package dependency;
  • The .targets file overrides the CopyFilesToOutputDirectory build target, leaving the AfterBuild target free for further customizaton;
  • It attempts to guess the reasonable merge order for the included assemblies and lets you to finetune it with a configuration file.

ILMerge.exe is not included into this package because its license prohibits redistribution. Referencing it as package dependency and loading it from its package location ensures that the latest ILMerge version is always used.