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
You could try downgrading ILMerge to 2.14.1208.
This solved it for me.
https://github.com/emerbrito/ILMerge-MSBuild-Task/issues/13
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With