-
Notifications
You must be signed in to change notification settings - Fork 15
Home
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.
![](https://github.com/emerbrito/ILMerge-MSBuild-Task/raw/master/Images/project_to_merge_output.png)
By default all references with Copy Local equals true are merged with your project output.
![](https://github.com/emerbrito/ILMerge-MSBuild-Task/raw/master/Images/copy_local_property.png)
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.