+1  A: 

This is going to take some work, since Team Build assumes that the set of files being monitored for changes and the set of files you want to download (the build workspace) are the same thing. I would write a custom msbuild task. Basic steps:

  1. Get the local version of the special file with GetExtendedItem()
  2. Compare it against the version recorded in the previous successful build (store this info in the registry, or maybe some hardcoded path)
  3. If the versions match, abort the build
  4. If not, continue the build
  5. If the build is successful, update the registry

Besides GetExtendedItem() [this is the API that tf prop calls, by the way], the other info that might be useful for a task like this is the most recent changeset contained in the workspace. To get this efficiently, use QueryHistory instead, passing a WorkspaceVersionSpec for both versionFrom and versionTo. Equivalently: tf hist $/ -r -version:W~W

Richard Berg