Skip to main content

Posts

Showing posts from September, 2008

Recursive Copy in TFS MSBuild

In working with TFS I just discovered the Well-Known Item Metadata (bad name in my opinion as I don't they they are really all that "Well-known") which can be used in MSBuild. One of these is %(RecursiveDir) . From MSDN:If the Include attribute contains the wildcard **, this metadata specifies the path to the file, beginning at the location of the wildcard. For more information on wildcards, see How to: Use Wildcards to Build All Files in a Directory. This example has no RecursiveDir metadata, but if the following example was used to include this item, the item would contain a RecursiveDir value of MyProject\Source\. <ItemGroup><MyItemInclude="C:\**\Program.cs"/></ItemGroup>If the following example was used to include this item, the RecursiveDir value of the item would remain MyProject\Source\. <ItemGroup><MyItemInclude="C:\**\Source\Program.cs"/></ItemGroup> This gives a lot of flexibility when using MSBuild. It all…