user2934433
user2934433

Reputation: 453

VSTS - NUGET creation build number as version

I am setting up a continuous integration of my nuget packgae on VSTS, I am following the steps mentioned here https://learn.microsoft.com/en-us/vsts/build-release/tasks/package/nuget to have build number as nuget version.

I am using 2.* of nuget pack with automatic package Versioning set to use the build number and build number format under options set to $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r).

But this does not effect my version it always comes to be same 2.0.1

I am unable to understand what additional task has to be done.

Upvotes: 0

Views: 638

Answers (1)

starian chen-MSFT
starian chen-MSFT

Reputation: 33698

The build number has been updated by GitVersionTask. So, disable it by specifying UpdateAssemblyInfo to false.

<PropertyGroup>
  ...
  <UpdateAssemblyInfo>false</UpdateAssemblyInfo>
  ...
</PropertyGroup>

Article: GitVersionTask Conditional control tasks.

If you don’t need to update the version, you can uninstall GitVersionTask package.

Upvotes: 1

Related Questions