Search code examples
msbuildmsbuild-task

MSBuild CopyTask: Copying the same file to multiple locations


Is there a way to get the CopyTask to copy the same file to multiple locations?

eg. I've generated an AssemblyInfo.cs file and want to copy it across to all my projects before building.


Solution

  • Check out the RoboCopy build task which is part of the Community Build Tasks library which you can find here. RoboCopy can copy one source file to multiple destinations.

    On a side note: why don't you use one AssemblyInfo file on solution level and link to that in your projects if you need the same information in every project? Check out my accepted answer on this question: Automatic assembly version number management in VS2008