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.
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.