Nuget pack command produces wrong file name

227 Views Asked by At

I'm using Nuget.exe v3.5 command line tool to package my nuget packages. One of the two packages uses a regular 4 dots version number a.b.c.d and it worked as expected.

C:\nuget\nuget.exe pack C:\useful-stuff\4.5.0.2\useful-stuff.nuspec -outputdirectory C:\useful-stuff-pkg\ -properties id=useful-stuff;version=4.5.0.2
>> useful-stuff.4.5.0.2.nupkg

But another package uses yyyymmdd.c version and the nupkg file produced has an extra 0. It should be useful-stuff2.20161221.0.nupkg but instead, it got an extra and became useful-stuff2.20161221.0.0.nupkg. What am I doing wrong here?

C:\nuget\nuget.exe pack C:\useful-stuff2\20161221.0\useful-stuff2.nuspec -outputdirectory C:\useful-stuff2-pkg\ -properties id=useful-stuff2;version=20161221.0
>> useful-stuff2.20161221.0.0.nupkg

UPDATE:

I also tried to reversion the first one usefull-stuff from 4.5.0.2 to 20161221.0 and got it to produce usefull-stuff.20161221.0.0.nupkg which also had the extra 0. That proves it's not the problem of the useful-stuff2 package, but more likely Nuget.exe itself.

Seems like if the version has 3 groups of digits a.b.c then Nuget.exe does not add the additional 0. So I think it's trying to make sure the version always has at least 3 groups of digits.

0

There are 0 best solutions below