title: TeamCity + MSBuild: Tagging a deployment with a VCS build number
body: <p>I am using TeamCity 4.5.1 to build and deploy an ASP.Net application to development.</p>
  
  <p>This is working perfectly so far, however, my manager has asked that I tag the folder with the specific SVN Revision from which the source was compiled.</p>
  
  <p>I am using an MSBuild script to do the build and deployment, however, I am unable to successfully retrieve the build number.</p>
  
  <p>Here is the MSBuild command I'm using (sanitized):</p>
  
  <pre><code>&lt;Exec Command="&amp;gt;\\server08\D$\Websites\MYPROJECT\version.txt echo %env.BUILD_VCS_NUMBER%,%env.BUILD_VCS_NUMBER.1%,%system.build.vcs.number%,%system.build.vcs.number.1%,%system.build.number.format%,%system.build.number.format.1%,%system.build.vcs.number.MYPROJECT_Web_Root%,%env.TEAMCITY_VCS_NUMBER_MYPROJECT_Web_Root%" /&gt;
  </code></pre>
  
  <p>Version.txt turns up like this:</p>
  
  <pre><code>,,,,,,,,
  </code></pre>
  
  <p>Aka, empty.  What am I doing wrong?  Any better way to do this?</p>