Search code examples
tfsmsbuildtfsbuildchangeset

TFS Build specific changeset and deploy it using the changeset number


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?


Solution

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