I'm trying to exclude a series of files from a custom deployment step in my TFS 2008 build definition. I want to include all files except those starting with either P0 or P1. Here are some of my attempts...
<ItemGroup>
<FilesToCopy Include="$(BinariesRoot)\Debug\*.*" Exclude="$(BinariesRoot)\Debug\P0*.*;$(BinariesRoot)\Debug\P1*.*" />
</ItemGroup>
and
<PropertyGroup>
<FilesToExclude>$(BinariesRoot)\Debug\P0*.*;$(BinariesRoot)\Debug\P1*.*</FilesToExclude>
</PropertyGroup>
<ItemGroup>
<FilesToCopy Include="$(BinariesRoot)\Debug\*.*" Exclude="$(FilesToExclude)" />
</ItemGroup>
and
<PropertyGroup>
<FilesToExclude>$(BinariesRoot)\Debug\P0*.*;$(BinariesRoot)\Debug\P1*.*</FilesToExclude>
</PropertyGroup>
<ItemGroup>
<FilesToCopy Include="$(BinariesRoot)\Debug\*.*" Exclude="@(FilesToExclude)" />
</ItemGroup>
When I come to copy the files using this...
<Copy SourceFiles="@(FilesToCopy)" DestinationFolder="T:\Deployment\" />
... it always copies all files (i.e. doesn't exclude the P0 and P1 files).