title: MSBuild TFS Build Number
body: <p>I have been using SVN for a little while now.  recently on a project I am using TFS. With the builds I like to append/update the build version number on the project output.  I do this on the masterpage so that it is clearly visible on the application.  Since the application could be running on multiple machines, it is handy information on which verison are running.</p>
  
  <p>I achive this in SVN world as:</p>
  
  <pre><code>  &lt;!-- Import of the MSBuildCommunityTask targets --&gt;
      &lt;Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" /&gt;
      &lt;!-- to AssemblyInfo to include svn revision number --&gt;
      &lt;Target Name="BeforeBuild"&gt;
        &lt;SvnVersion LocalPath="$(MSBuildProjectDirectory)" ToolPath="$(ProgramFiles)\CollabNet Subversion Client"&gt;
          &lt;Output TaskParameter="Revision" PropertyName="Revision" /&gt;
        &lt;/SvnVersion&gt;
        &lt;Time&gt;
          &lt;Output TaskParameter="Year" PropertyName="Year" /&gt;
          &lt;Output TaskParameter="Month" PropertyName="Month" /&gt;
          &lt;Output TaskParameter="Day" PropertyName="Day" /&gt;
        &lt;/Time&gt;
        &lt;FileUpdate Files="MasterPage.master" Regex="svn revision: (\d+)\.(\d+)\.(\d+)\.(\d+)" ReplacementText="svn revision: $(Year).$(Month).$(Day).$(Revision)" /&gt;
      &lt;/Target&gt;
  </code></pre>
  
  <p>As you can see above the "BeforeBuild" task updates the masterPage.master file with the YYYY.MM.DD.SVNVERSION stamp.</p>
  
  <p>How can I achive this with TFS as the source control.  How do I get the TFS build number?</p>