mikefourie-zz / MSBuildExtensionPack

MIT License
366 stars 104 forks source link

MSBuild.ExtensionPack.FileSystem.RoboCopy fails with Code 16 if source path has spaces in name #73

Closed MagicAndre1981 closed 6 years ago

MagicAndre1981 commented 6 years ago

I've added a MSBuild.ExtensionPack.FileSystem.RoboCopy task to copy the output to a remote device to do remote debugging:

<Target Name="AfterBuild">
    <MSBuild.ExtensionPack.FileSystem.RoboCopy Source="$(TargetDir)\" Destination="\\Foo\Bar" Files="@(OutputFiles)">
      <Output TaskParameter="ExitCode" PropertyName="Exit" />
      <Output TaskParameter="ReturnCode" PropertyName="Return" />
    </MSBuild.ExtensionPack.FileSystem.RoboCopy>
    <Message Text="ExitCode = $(Exit)" />
    <Message Text="ReturnCode = $(Return)" />
  </Target>

This works fine until the source path has spaces, here the task fails with robocopy return code 16.

I use VS2017-15.4, Win10 v1709 with a WinForms 4.7.1 project.

mikefourie-zz commented 6 years ago

Spaces should be handled fine. I can't repro this. Can you send log output?

working sample

 <MSBuild.ExtensionPack.FileSystem.RoboCopy Source="c:\aa - Copy\" Destination="\\foo\bar" Files="@(OutputFiles)">
    <Output TaskParameter="ExitCode" PropertyName="Exit" />
    <Output TaskParameter="ReturnCode" PropertyName="Return" />
  </MSBuild.ExtensionPack.FileSystem.RoboCopy>