0
votes

I am setting up a continuous integration of my nuget packgae on VSTS, I am following the steps mentioned here https://docs.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.

1
Have you reviewed this blog post?techvice
I did but I could not see anything related to build number as automatic versioning, tell me if I missed somethinguser2934433
Can you reproduce this issue with a new build definition? Can you share the detail log on the OneDrive? (Set system.debug variable to true)starian chen-MSFT
Based on the log, the build number is 2.0.1-OnPremServicingFargo.28. What's the result if you try it with a new build definition? BTW: I can't access your VSTS.starian chen-MSFT
When I try to create a new build even though the build number changes nuget gets versioned as 2.0.1 and nuget publish fails since it is same version. What I am really looking to get is a unique version from build number. May be like 2.0.1.28 and more over I am not clear by the build number is not $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r).user2934433

1 Answers

1
votes

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.