ILMerge.exe not found

Jan 15, 2015 at 4:08 PM
Edited Jan 15, 2015 at 4:09 PM
Forgive my ignorance, but I have added the ILMerge and MSBuild ILMerge Task nuget packages to my project, but am getting the error message listed below. Everything is installed at the default location (Solution/packages), so I'm not sure where it is looking for the executable. Any help would be greatly appreciated.

Error 26 The "MSBuild.ILMerge.Task" task failed unexpectedly.
System.IO.FileNotFoundException: Cannot find ILMerge executable.
at MSBuild.ILMerge.Task.LoadILMerge()
at MSBuild.ILMerge.Task.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() BrandingTool_OnPrem
```
Coordinator
Apr 1, 2015 at 10:27 AM
Are you sure you are using the latest version of this package? ILMerge.exe location was changed at least once in ILMerge package, I had to correct for that.

Otherwise, the fastest way to find what goes wrong is to uncomment lines 807 & 813 in Task.cs and use rebuilt task dll. It will log where it searches.
Apr 13, 2016 at 1:47 PM
I had the same problem. The NuGet package requires ILMerge 2.13.0307 but I then upgraded it to the latest version (2.14.1208) which has moved the location of the tool to a nested tools folder.

To solve it I deleted the ILMerge.x.x.x folder from the packages folder and edited the packages.config file to point to the old version and reloaded VS.

Perhaps we could have a newer version of the task that targets the latest version?

Thanks,
Sam
Apr 27, 2016 at 7:55 PM
I followed @samcragg's feedback and those directions also worked for me. So for now, it appears not to Update the ilmerge nuget package.
Coordinator
Jul 11, 2016 at 8:57 AM
Fixed in 1.0.5-rc1.
Oct 5, 2016 at 8:23 AM
I'l getting this error on 1.0.5, and it doesn't matter which ILMerge package I update to.

1>C:\Users\Jahmai.nuget\packages\MSBuild.ILMerge.Task\1.0.5\build\MSBuild.ILMerge.Task.targets(87,5): error MSB4018: The "MSBuild.ILMerge.Task" task failed unexpectedly.
1>C:\Users\Jahmai.nuget\packages\MSBuild.ILMerge.Task\1.0.5\build\MSBuild.ILMerge.Task.targets(87,5): error MSB4018: System.IO.FileNotFoundException: Cannot find ILMerge executable.
1>C:\Users\Jahmai.nuget\packages\MSBuild.ILMerge.Task\1.0.5\build\MSBuild.ILMerge.Task.targets(87,5): error MSB4018: at MSBuild.ILMerge.Task.LoadILMerge()
1>C:\Users\Jahmai.nuget\packages\MSBuild.ILMerge.Task\1.0.5\build\MSBuild.ILMerge.Task.targets(87,5): error MSB4018: at MSBuild.ILMerge.Task.Execute()
1>C:\Users\Jahmai.nuget\packages\MSBuild.ILMerge.Task\1.0.5\build\MSBuild.ILMerge.Task.targets(87,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Users\Jahmai.nuget\packages\MSBuild.ILMerge.Task\1.0.5\build\MSBuild.ILMerge.Task.targets(87,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

I'm referencing them on a netstandard project if that makes any difference.
Oct 5, 2016 at 10:38 AM
I think this is because nuget created the package in:

C:\Users\Jahmai\.nuget\packages\ilmerge\2.13.307

And the build task is expecting:

C:\Users\Jahmai\.nuget\packages\ilmerge.2.13.307