How to customize the NuGet (pack) package version number

Hi,

We're moving our enterprise framework and our applications to Team-City (8.0.6). Builds of the framework are working well by downloading the code from GIT, build it using Nant and then build / pack the NuGet packages for all the framework assemblies using team city's "Pack NuGet package" build step. We left the package version blank so NuGet can handle it by using the assembly version in the .csproj next to the .nuspec file. This works well for all our framework branches.

But now we like to customize the package versions so we see that they are a pre-release of the CI.

Example:
On the master branch our framework ist in version 1.10.0.0 so packages gets generated with this version. But we like that the packages gets a version like 1.10.0.0-alpha432. The last number for example is the build numer or couter of team city while the first part is the version number of the .csproj (assembly info). All combined with a prerelease tag like "-alpha".

Therefore I imagine a package version like: %assemblyversion%-alpha%buildno%

Is something like this possible at all and if yes, how?

Any help would be great!

Cheers,
Marc

Please sign in to leave a comment.