Skip to main content

Posts

Showing posts from June, 2008

Copy Multiple Files via TFS build

bI have recently been doing a lot of work with TFS and want to write about a few things I had to figure out how to do. As part of my build process I had a number of dlls I needed to copy out to my staging environment. To do this I overrode the AfterCompile target. In order to override this Target you have to import the Microsoft.Common.targets file.<Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" />In MSBuild you can call Copy which will move a file from one location to another location. The key word here is that it will move "a file", it will not move "files." So you can call something like this:<Copy SourceFiles="$(DeployStagePath)\my.dll" DestinationFolder="$(DeployPath)" /> But you cannot use code like this to copy all dll files:<Copy SourceFiles="$(DeployStagePath)\*.dll" DestinationFolder="$(DeployPath)" /> To copy all dlls in a folder you need to create a new it…