This project has moved. For the latest updates, please go here.
1
Vote

Empty $versionNumber causes build error

description

I'm using VS 2013 Ultimate and these bits to create a NuGet package in Post Build and over all it works, but if I try to set $versionNumber to "", I get the following error despite what the comments in Config.ps1 say.

" # e.g. "" (use assembly's version), "1.2.3" (stable version), "1.2.3-alpha" (prerelease version). "
$versionNumber = ""

Output:
...
1> An error occurred while running New-NuGetPackage script:
1> A valid version number to use for the NuGet package was not provided, so exiting script. The version number provided was '', which does not conform to the Semantic Versioning guidelines specified at http://semver.org.
1>
1> A valid version number to use for the NuGet package was not provided, so
1> exiting script. The version number provided was '', which does not conform to
1> the Semantic Versioning guidelines specified at http://semver.org.
1> At C:\Infrastructure...\NetworkToolingEngine_
1> CreateNewNuGetPackage\DoNotModify\New-NuGetPackage.ps1:413 char:4
1> + throw "A valid version number to use for the NuGet package was
1> not provided, ...
1> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1> ~~~~~~~~~~~~
1> + CategoryInfo : OperationStopped: (A valid version...p://semver.
1> org.:String) [], RuntimeException
1> + FullyQualifiedErrorId : A valid version number to use for the NuGet pack
1> age was not provided, so exiting script. The version number provided was '
1> ', which does not conform to the Semantic Versioning guidelines specified
1> at http://semver.org.

FYI

comments

deadlydog wrote Apr 13 at 5:55 AM

I believe this issue is fixed in the latest version of the script and NuGet package. Could you try again and let me know if you still receive the error please. If you do still get the error, can you let me know what your project's version is set to. Thanks.