Marc Gravell
Marc Gravell

Reputation: 1062745

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?

Upvotes: 8

Views: 916

Answers (1)

vcsjones
vcsjones

Reputation: 141638

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.

Upvotes: 3

Related Questions