Monthly Archives: November 2010

MSBuild CopyTask: Copying the same file to multiple locations

As a response to another post on stackoverflow (http://stackoverflow.com/questions/2026527/answer/), a much easier solution is to use task batching: <ItemGroup> <AssemblyInfoSource Include=”AssemblyInfo.cs” /> <Destinations Include=”$(Destination1);$(Destination2)” /> </ItemGroup> <Target Name=”PropagateAssemblyInfo”> <Copy SourceFiles=”@(AssemblyInfoSource)” DestinationFolder=”%(Destinations.FullPath)”> </Copy> </Target> The % symbol tells MSBuild to repeat

Tagged with:
Posted in Development