TFS Team Build DropLocation


I’m running multiple build servers and want drops to go to the relevant build server rather than a central drop folder. The TFSBuild.proj file has a property called DropLocation that specifies where to drop build output. I decided to add a property to the value of DropLocation to make the build drop locally:

    <DropLocation>\\$(COMPUTERNAME)\drops\CI—ProductXYZ</DropLocation>

Easy enough, but running a build resulted in:

TF42042: Failed to connect to drop location \\$(COMPUTERNAME)\drops please ensure that is is a valid share.

It’s not the $, using %24 gives the ‘same’ message. It looks like the build process is using EvaluatedProperties.Value rather than FinalValue.

Luckily there is a way to get around this small bug. I overrode BeforeEndToEndIteration and set DropLocation in there:

<Target Name=”BeforeEndToEndIteration” Condition=”‘$(IsDesktopBuild)’!=’true'”>
<ShowBuildStep TeamFoundationServerUrl=”$(TeamFoundationServerUrl)” BuildURI=”$(BuildUri)” BuildStep=”TARGET OVERRIDE: BeforeEndToEndIteration”/>
<CreateProperty Value=”\\$(COMPUTERNAME)\drops\CI—ProductXYZ”>
<Output TaskParameter=”Value” PropertyName=”DropLocation” />
</CreateProperty>
</Target>

If you are wondering what ShowBuildStep is, take a look at this post

Leave a Reply

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

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