There are a few options available when configuring your nuget package versioning scheme in your build pipeline.
Let’s explore the differences:
Off
The package version is not changed during the build. Instead the version provided in your csproj file is used.
Use the date and time
When selecting the ‘Use the date and time’ option, it is up to you to provide a Major, Minor and Patch version number. The datetime will be used as the prerelease label:
$(Major).$(Minor).$(Patch).$(date:yyyyMMdd)
Use an environment variable
A third option is to use an environment variable. The environment variable should contain the version number that you want to use and should be in a valid format.
Remark: You should enter the name of the environment variable without $, $env, or %.
Use the build number
A last option is to use the build number. This will use the build number to version the package.
Remark: This will change the build number format to a version compatible definition: '$(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)'.