Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to use use "MSBuild.ILMerge.Task" with PackageReference

When using MSBuild.ILMerge.Task referenced via packagereference the following error came up:

error MSB4018: The "MSBuild.ILMerge.Task" task failed unexpectedly.
error MSB4018: System.IO.FileNotFoundException: Cannot find ILMerge 
executable.
error MSB4018:    at MSBuild.ILMerge.Task.LoadILMerge()
error MSB4018:    at MSBuild.ILMerge.Task.Execute()
error MSB4018:    at error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

This is because the MSBuild.ILMerge.Task.dll can't find the ILMerge executable in its package location. I guess the main reason of this may be the different folder structure between package.config and PackageReference.

Has anyone else had this issue? Any help is appreciated in advance

like image 202
Demian Avatar asked Aug 06 '18 17:08

Demian


1 Answers

You could try downgrading ILMerge to 2.14.1208.

This solved it for me.

https://github.com/emerbrito/ILMerge-MSBuild-Task/issues/13

like image 177
Chriss Cross Avatar answered Oct 17 '22 14:10

Chriss Cross