Update: 3 December 07 – The RTM version of MSBuild 2008 fixes this issue!
- If braces ‘()’ are in the source path of a file copy operation that uses %(RecursiveDir), then the contents are copied to the root of the destination with no folder structure maintained.
- This affects MSBuild 2005 & MSBuild 2008 (3.5) Beta 1 & Beta 2
- Run the following on VS 2005 (add ToolsVersion="3.5" if running on VS2008)
<Project DefaultTargets="DeployFiles" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<FilesToCopy Include="C:\Debug (bug)\SomeFolder\**\*.*">
<Copy SourceFiles="%(FilesToCopy.Identity)" DestinationFolder="%(FilesToCopy.Destination)\%(RecursiveDir)"/>
- The path without braces copies correctly and maintains folder structure.
- The path with braces places all files into the root destination folder.
- Use exec and call out to xcopy
- Write you own copy task!
Hopefully this gets fixed in Beta 2…FTD