emerbrito / ILMerge-MSBuild-Task

Adds ILMerge to Visual Studio 2013/2017 or automated builds. This Task is intended to work right out of the box however, it supports a configuration file where you can control every ILMerge property including the list of assemblies to be merged.
MIT License
54 stars 15 forks source link

CreateDirectory error #17

Closed fmerkel closed 5 years ago

fmerkel commented 6 years ago

After setting "OutputFile" to $(OutDir)FooBar.dll and deleting the bin folder, the following error occurs:

Error       The "MergeTask" task failed unexpectedly.
System.ArgumentException: Path cannot be the empty string or all whitespace.
   at System.IO.Directory.CreateDirectory(String path)
   at ILMerge.MsBuild.Task.MergeTask.LogConfigFile(MergerSettings settings) in D:\Dev\Github\ILMerge-MSBuild-Task\ILMerge.MSBuild.Task\ILMerge.MSBuild.Task\MergeTask.cs:line 576
   at ILMerge.MsBuild.Task.MergeTask.Execute() in D:\Dev\Github\ILMerge-MSBuild-Task\ILMerge.MSBuild.Task\ILMerge.MSBuild.Task\MergeTask.cs:line 164
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() FooBar

The workaround is to specify $(ProjectDir)\\bin\\Debug\\FooBar.dll instead.

I also noticed another quirk where setting "OutputFile" to $(OutDir)\\FooBar.dll doesn't produce an error, but actually creates a folder called "$(OutDir)" in the project directory.

emerbrito commented 5 years ago

@fmerkel thanks for your feedback. Man its been a while I don't stop by here. My delay is due to email notifications issues that I hope I fixed for good this time. My apologies.

Please take a look at the "Using Variables" section of the documentation: https://github.com/emerbrito/ILMerge-MSBuild-Task/wiki/Config-File

If you want your target folder to be "[project_folder]\bin\Debug\" you should be using "$(TargetDir)" instead, $(OutDir) as you may have noticed is not supported.

emerbrito commented 5 years ago

Closed due to inactivity. Please feel free to reopen it if the issue persists.