Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Sem versioning 2.0
-
Im trying to upload a package called:
Mypackage.1.0.27.14-commit.33ed7ba
As far as I know this is a valid sem version 2 string, however I receive an error:
Invalid version number.
Inedo.ProGet.Feeds.NuGet.LegacyNuGetVersion.Parse(String version) +214
Inedo.ProGet.Feeds.NuGet.NuGetPackage.ReadFromNuspecFile(Stream nuspecStream, Boolean legacyVersion) +803We are using the latest version (5.0.8) and I migrated the feed so that it should use sem ver 2.
From the stack trace I assume it still using the old way sem version. How can I force to use sem ver 2?
Maarten
Product: ProGet
Version: 5.0.8
-
The stack trace seems to indicate that it's using the LegacyNuGetVersion, so I'm thinking... it's not migrated?
I would try to make a new feed, and then try the epackage in it? For some reason, it seems not to have migrated...
-
Well, I already created a new feed: Same result. It still feels that something down the line is using the old format.
Any other ideas?
-
This was resolved through a ticket, but the answer I posted there will probably be useful to the general public:
LegacyNuGetVersion
gets called ifSemVer2NuGetVersion
is unable to parse the version number.In this case, the version number
1.0.27.14-commit.33ed7ba
is neither a valid semantic version (SemVer wants 3 parts before the hyphen, but there are 4) nor a valid legacy version (I believe this is because of the.
aftercommit
).For SemVer, something like
1.0.27-build.14.commit.33ed7ba
would work. A warning, though: if the commit hash contains only digits 0-9 and the first digit is 0, that is not a valid SemVer either. (spec section 9)A SemVer with a hyphen in it is considered to be a pre-release version, so using
1.0.27-build.14+commit.33ed7ba
and then removing the-build.*
part for the final version of 1.0.27 would work. If the commit hash is put after a plus sign, it also won't have problems with leading zeroes. (spec section 10)