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=”″ ToolsVersion=”3.5″>
<SomeFiles1 Include=”\\OrcasBeta1TFS\c$\AFolder\**\*.*”/>
<SomeFiles2 Include=”\\OrcasBeta1TFS\c%24\AFolder\**\*.*”/>
<SomeFiles3 Include=”\\OrcasBeta1TFS\NewShare\**\*.*”/>

<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)’)”/>

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!..


Leave a Reply

Fill in your details below or click an icon to log in: Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s