Srikanth Sridharan
Srikanth Sridharan

Reputation: 21

TFS SourceDirectory of EnvironmentVariable is always empty

I'm setting up TFS to publish a WPF project. To setup the publish, I tried to get the SourceDirectory from the EnvironmentVariable through the GetEnvironmentVariable Activity and load into a variable. But the SourceDirectory always turns empty.

Does the SourceDirectory turn up by default of should I set something to make the SourceDirectory show up in the EnvironmentVariable? Thanks.

Upvotes: 0

Views: 55

Answers (1)

James Harcourt
James Harcourt

Reputation: 6379

How I have done this is to modify the build template, so I would initialise build directory and binaries subfolder as follows:

<mtbwa:GetBuildDirectory DisplayName="Get the Build Directory" 
                         Result="[BuildDirectory]" />

<Assign x:TypeArguments="x:String" 
        DisplayName="Initialize Binaries Directory" 
        To="[BinariesDirectory]" 
        Value="[String.Format(&quot;{0}\Binaries&quot;, BuildDirectory)]" />

Then you can copy the output binaries like so:

<mtbwa:CopyDirectory Destination="[CopyToFolder]" Source="[BinariesDirectory]" />

The "BuildDirectory" and "BinariesDirectory" variables would be declared as follows:

<Variable x:TypeArguments="x:String" Name="BuildDirectory" />
<Variable x:TypeArguments="x:String" Name="BinariesDirectory" />

Upvotes: 1

Related Questions