Beware $ in MSBuild 3.5

In November 2006 I wrote ‘Beware $ in MSBuild 1.0’. Working with Visual Studio 2008 Beta 1 which has MSBuild 3.5, I am getting the same unexpected behaviour:

<Project DefaultTargets="Prepare" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<ItemGroup>
<SomeFiles1 Include="\\OrcasBeta1TFS\c$\AFolder\**\*.*"/>
<SomeFiles2 Include="\\OrcasBeta1TFS\c%24\AFolder\**\*.*"/>
<SomeFiles3 Include="\\OrcasBeta1TFS\NewShare\**\*.*"/>
</ItemGroup>

<Target Name="Prepare">
<Copy SourceFiles="@(SomeFiles1)" DestinationFiles="@(SomeFiles1->’c:\SomeFolder1\%(RecursiveDir)%(Filename)%(Extension)’)"/>
<Copy SourceFiles="@(SomeFiles2)" DestinationFiles="@(SomeFiles2->’c:\SomeFolder2\%(RecursiveDir)%(Filename)%(Extension)’)"/>
<Copy SourceFiles="@(SomeFiles3)" DestinationFiles="@(SomeFiles3->’c:\SomeFolder3\%(RecursiveDir)%(Filename)%(Extension)’)"/>
</Target>
</Project>

SomeFiles1 – all files will all be copied to SomeFolder1 with no directory structure maintained. This is not expected behaviour !
SomeFiles2 – the files will be found and the directory structure will be maintained. This is expected behaviour.
SomeFiles3 – this is a new share mapped to the server path and behaviour will be as for SomeFiles2. This is expected behaviour.

I did log the bug, though perhaps it hasn’t made the cut for the next version of MSBuild… let’s wait for Beta 2!…FTD

Advertisements
This entry was posted in MSBuild. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s