I need to strongly name my assemblies and working for past companies I remember the pain of explicitly versioning assemblies with build numbers. I'd like to copy the model that Microsoft use for example for the .Net framework DLLs. Once it is released, the version is fixed (AssemblyVersion), and this makes XCopy or hot fixing much easier later. However, I think it would be a good idea in the AssemblyFileVersion or AssemblyDescription to still have the build count.
I'd also like to use the build count to name my zip file at the end of the build process.
So, in TeamCity I have explicitly declared the version number as 1.0.09 and I can retrieve this in my build script (MSBUILD) as BUILD_NUMBER. Is there anyway I can populate the build count into a variable? So I could do something like:
AssemblyVersion="$(BUILD_NUMBER)" AssemblyFileVersion="$(BUILD_NUMBER) ($(BUILD_COUNT))"/>
Any tips about strong name assemblies (and avoiding pain) and doing this in TeamCity would be a great help.