Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
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+)?"

Browse Categories