Quantcast
Channel: WE MOVED to github.com/nuget. This site is not monitored!
Viewing all articles
Browse latest Browse all 7612

Commented Unassigned: NuGet imposes artificial max string length of 20 characters for "SpecialVersion" (aka pre-release) [3426]

$
0
0
Just ran into a problem where we have a base pre-release identifier of something like 16 characters, but then, in order to create a newer version, we usually append a yyyyMMddbb string to those which send it over 20 characters and got an InvalidOperationException from NuGet telling me it exceeds 20 characters.

The offending logic is in PackageBuilder::ValidateSpecialVersionLength which is called by PackageBuilder::Save. I see no mention of a maximum string length for pre-release identifiers in the SemVer specification (either v1 or the new v2), therefore this check should not even exist. The only mention in the v2 spec is that the _entire_ version string should not exceed 255 characters in total string length.
Comments: We have changed our identifier already, so this is a forward thinking recommendation. It seems odd to me that the NuGet team to declare that 20 characters is enough for everybody in the world, especially when supposedly trying to abide by SemVer versioning rules which has no such specified restriction. Now, maybe you want to impose the restriction for NuGet.org itself and, ok, that's totally up to you. In fact, for my use case (and probably that of many others), I'm not publishing my pre-release packages to the official NuGet feed anyway. However, I don't see why such a limitation it needs to be imposed within in _NuGet Core_ such that third parties can't even build their own packages with IDs of their choosing. The truth is this only a bigger problem for because I'm forced to append a build number to the static pre-release identifier. Once NuGet has support for SemVer 2.0 build #s this will probably become a non-issue for me, though I still see no good reason to impose the restriction in NuGet Core.

Viewing all articles
Browse latest Browse all 7612

Latest Images

Trending Articles



Latest Images