0 votes
1 view
in Azure by (5.8k 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 (9.6k 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+)?"

Welcome to Intellipaat Community. Get your technical queries answered by top developers !