.NET Bits

.NET tidbits

Passing Dynamic Properties in TFS

Scenario: You have a TFS.proj file that builds a solution file and you want to pass a dynamically generated property to the solution file you are building. Eg  it could be the version number that had to be passed over to the solution / say web deployment project. 

<SolutionToBuild Include="MySolution.sln">
      <
Properties>Version=$(Version)</Properties>
    </
SolutionToBuild>

The above code snippet will not work .Instead you have to  make use of the CustomPropertiesForBuild  reserved property and do something like this

<PropertyGroup> <CustomPropertiesForBuild>$(CustomPropertiesForBuild);Version=$(Version)</CustomPropertiesForBuild> </PropertyGroup>

This will ensure that the property Version is passed on to every solution that the Team foundation Build calls.

If you want to  pass custom properties into every solution when the TFS Build calls the Clean Target then you should be using the reserved property CustomPropertiesForClean

See this post for some more info

Posted: Sep 18 2008, 07:46 AM by Jeev | with 3 comment(s)
Filed under:

Comments

weblogs.asp.net said:

Passing dynamic properties in the tfs.. OMG! :)

# March 31, 2011 6:13 AM

weblogs.asp.net said:

Passing dynamic properties in the tfs.. Tiptop :)

# April 27, 2011 12:47 PM

weblogs.asp.net said:

Passing dynamic properties in the tfs.. Super :)

# June 10, 2011 12:18 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)