TFS Build specific changeset and deploy it using the changeset number

13,090

Solution 1

The answer to your first question is clearly what @Dylan has stated.

To your second part:
The important argument is GetVersion. Navigate to activity "Run MSBuild for Project" within your Build Process Template, by default this has a value CommandLineArguments equal to

String.Format("/p:SkipInvalidConfigurations=true {0}", MSBuildArguments)

You can change it to something like

String.Format("/p:SkipInvalidConfigurations=true {0} /p:DeployIisAppPath=/changeset/{1}", MSBuildArguments, GetVersion)

and get where you need to go.

Solution 2

When you queue up the build from Team Explorer, in the Parameters tab one of the Advanced arguments is get version.

Note: I think you need to specify this in the form C123 where 123 is the changeset number.

Share:
13,090
Konrad
Author by

Konrad

C#, Agile, TFS, ...

Updated on June 12, 2022

Comments

  • Konrad
    Konrad almost 2 years

    I have a Build Definition to build a solution on my TFS. This works well, but it always builds the latest version.

    1. How can I force to build a specific changeset from the past?

    2. How can I use/pass this number to the "MSBuild Arguments" to use it there for deployment?

  • Konrad
    Konrad over 12 years
    thank you ... that anwsered the first question ... but how can I pass this parameter (C1234) to the MSBuild Arguments to use it for deployment?
  • Dylan Smith
    Dylan Smith over 12 years
    It's in one of the workflow arguments, you can access that when setting the arguments passed to the msbuild (you'd have to customize the build workflow)
  • Konrad
    Konrad over 12 years
    Creating a new template is the way to go. I only had to change "GetVersion" into "BuildDetail.SourceGetVersion" to get the latest build version :-)
  • Shimmy Weitzhandler
    Shimmy Weitzhandler about 9 years
    My current Build process file is set to TfvcContinuousDeploymentTemplate.xaml, however I can't find that file in the BuildProcessTemplates folder.