title: How to pass TFS variable to a MSBuild task of the project
body: <p>I have a solution which is built on TFS server. This solution includes several projects which have custom MSBuild tasks. Theses tasks actually create some zip archives. </p>
  
  <p>I need to extract somehow the $(Rev) macros from the TFS build and pass it to the tasks. I tried to use MSBuildArguments in the process tab of the build definition and it works when I set a simple string value like:</p>
  
  <p>/p:Version="5" </p>
  
  <p>but it doesn't work with the macros:</p>
  
  <p>/p:Version="$(Rev:r)"</p>
  
  <p><img src="https://i.stack.imgur.com/5wiF6.png" alt="enter image description here"></p>
  
  <p>do you have any ideas?</p>
  
  <p>Edit: I actually needed BuildDetail.BuildNumber.</p>