0 votes
1 view
in Azure by (4k points)

Setting up a simple class library to build and publish to VSTS's own feed, I see this error when the NuGet package runs.

Could not find version number data in BUILD_BUILDNUMBER

I have the "Use Build number to version package" option ticked. Expected VSTS to just work.

1 Answer

0 votes
by (8.2k points)

You can set your build format like this: 

Write-Verbose "Autoversion: Getting version number from build"

##Get Version from Build

# Regular expression pattern to find the version in the build number 

# and then apply it to the assemblies

$VersionRegex = "\d+\.\d+\.\d+(?:\.\d+)?"

...