Search code examples
tfsbuild-processtfsbuild

Is there a way to validate the build process parameters when editing the build definition in TFS?


I tried looking on Google to see if this was possible but failed in getting results.

I have a build process file which requires some custom parameters to be set before executing the build.

I was wondering if there was a way to validate what was being entered for the custom parameters when editing the build definition in the 'Process' tab?

For example, I have two separate parameters which holds different file names in the same folder location. The build definition then has functionality to swap those file names around.

When editing these parameters, lets say the user enters the same name in both fields accidentally, is there are way to prompt the user (there and then) that (s)he needs to enter different file names?


Solution

  • There is a way through implementing a Custom Parameter Editor, as described in this post. Shortly, you write some custom WinForm code to input and validate parameters. If you go through this route consider

    • managing client side customization (test, deploy, update)
    • builds can be queued through other means (e.g. command line) and this code check the values only in Visual Studio
    • doubling the check in the workflow itself as ChrisBint suggested