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