How do I do a recursive copy?


""The Copy task doesn't natively support the ability to do a recursive copy, because the engine supports a %(RecursiveDir) attribute on every time that can be used to accomplish the same effect. However, the requirement is that you must declare an item list that uses the ** recursive wildcard syntax.""

So, for example, if you wanted to recursively copy all .DLL files under c:\foo\bar\ to c:\mydest\, here's how you would do it:

		 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
	

		     [<ItemGroup>]
		         <Dlls Include="c:\foo\bar\**\*.dll" />
		     [</ItemGroup>]
	

		     <Target Name="Build"
		         <Copy 
		          SourceFiles="@(Dlls)
		          DestinationFiles="@(Dlls->'c:\mydest\%(RecursiveDir)%(Filename)%(Extension)')"
		         />
		     </Target>
	

		 </Project>
	

For more information about the special ""RecursiveDir"" item attribute, see this page