- Create a property based on the MachineName.
- Use that property to update the AssemblyInfo.cs file(s) before building.
I have "SubVersionRevision" below, but just use an alternate syntax to get the TFS version (from the link you have in your original post)........
The Crux of the solution is : setting and using "MyCustomProperty001"
<Choose>
<When Condition=" '$(Computername)'=='MyDevMachine' ">
<PropertyGroup>
<MyCustomProperty001>0</MyCustomProperty001>
</PropertyGroup>
</When>
<When Condition=" '$(Computername)'=='MyQaMachine' ">
<PropertyGroup>
<MyCustomProperty001>1</MyCustomProperty001>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<MyCustomProperty001>9</MyCustomProperty001>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup>
<AssemblyInfoFiles Include="$(ProjectDir)\**\*AssemblyInfo.cs" />
</ItemGroup>
<SvnVersion LocalPath="$(MSBuildProjectDirectory)" ToolPath="$(SVNToolPath)">
<Output TaskParameter="Revision" PropertyName="MySubVersionRevision" />
</SvnVersion>
<FileUpdate Files="@(AssemblyInfoFiles)"
Regex="AssemblyFileVersion\("(\d+)\.(\d+)\.(\d+)\.(\d+)"
ReplacementText="AssemblyFileVersion("$1.$2.$(MyCustomProperty001).$(SubVersionRevision)" />