Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is pre-release versioning possible in nuget

According to the documentation, pre-release versioning is supported, with an example given of:

Within the NuSpec file, specify the version in the element

<version>1.0.1-alpha</version>

I am building from a .nuspec file; if I include this line verbatim, then run (at the package manager console):

PM> nuget pack "Nuget\protobuf-net.nuspec"

then I get a bit fat error:

Attempting to build package from 'protobuf-net.nuspec'.
NuGet.exe : Input string was not in a correct format.
At line:1 char:6
+ nuget <<<<  pack "Nuget\protobuf-net.nuspec"
    + CategoryInfo          : NotSpecified: (Input string wa...correct format.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

If, however, I just use <version>1.0.1</version> and run exactly the same command, then I get:

Attempting to build package from 'protobuf-net.nuspec'.
Successfully created package 'C:\Dev\protobuf-net\protobuf-net.1.0.1.nupkg'.

And indeed, it has built correctly. My NuGet Package Manager reports version 2.0.30625.9003.

So: am I doing something wrong? or did they break something?

like image 288
Marc Gravell Avatar asked Aug 09 '12 20:08

Marc Gravell


People also ask

How do I change NuGet package version?

Right-click the Packages folder in the project, and select Update. This will update the NuGet package to the latest version. You can double-click the Add packages and choose the specific version.

Does NuGet use SemVer?

NuGet 4.3. 0+ supports SemVer 2.0. 0, which supports pre-release numbers with dot notation, as in 1.0.


1 Answers

NuGet Version: 1.5.21005.9019

Semantic versioning was introduced in nuget 1.6. Time for an upgrade. You can use nuget update -self to update right from the command line.

like image 181
vcsjones Avatar answered Nov 04 '22 02:11

vcsjones