You can output the assembly number during the execution of the script assembly, and teamcity will use this output to mark the assembly. For example, I put my assembly in the same version as in AssemblyInfo.cs. Part of this version (Major, Minor) is actually in the file, another part (Build, Revision) is added during the build.
From my msbuild script:
<Target Name="Setup"> <Version VersionFile="Version.txt" BuildType="None" RevisionType="None"> <Output TaskParameter="Major" PropertyName="Major" /> <Output TaskParameter="Minor" PropertyName="Minor" /> </Version> <CreateProperty Value="$(BUILD_NUMBER)"> <Output TaskParameter="Value" PropertyName="Build" /> </CreateProperty> <CreateProperty Value="$(BUILD_VCS_NUMBER)"> <Output TaskParameter="Value" PropertyName="Revision" /> </CreateProperty> <AssemblyInfo CodeLanguage="CS" OutputFile="Properties\VersionInfo.cs" AssemblyVersion="$(Major).$(Minor).$(Build).$(Revision)" AssemblyFileVersion="$(Major).$(Minor).$(Build).$(Revision)" /> <Message Text="##teamcity[buildNumber '$(Major).$(Minor).$(Build).$(Revision)']" /> </Target>
you just output the version at build time, format ##teamcity[buildNumber '<buildnum>']
source share