Skip to content
Emerson Brito edited this page Mar 28, 2017 · 3 revisions

Getting Started

Use Nuget to add ILMerge.MSBuild.Task to your Visual Studio project:

Install-Package ILMerge.MSBuild.Task

Also install the ILMerge Package:

Install-Package ilmerge

Build your project. The merged assembly will be stored in an ILMerge folder under the project output.


Merge Assemblies With Copy Local = True

By default all references with Copy Local equals true are merged with your project output.



Creating a Static List of Assemblies to Merge

It is also possible to use a static list of assemblies instead of inspecting the Copy Local property. This can be done through a configuration file added to the root of your project. Create a JSON file and name it as follows:

ILMergeConfig.json

The following snippet uses the InputAssemblies property to specify the files to be merged into the project output.

{
	"General": {
		"InputAssemblies": [
		  "$(SolutionDir)libs\\XrmUtils.Plugins.Abstractions.dll", 
		  "$(SolutionDir)libs\\XrmUtils.Plugins.Utilitiesd.dll" 
		]
	}
}

You don't have to specify a path if assemblies are expected to be in the target directory:

{
	"General": {
		"InputAssemblies": [
		  "XrmUtils.Plugins.Abstractions.dll", 
		  "XrmUtils.Plugins.Utilities.dll" 
		]
	}
}

See Configuration File complete reference.