-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose OriginalVersion property on NuGetVersion #5068
Comments
Is there a reason to allow non-normalized SemVer2 versions? If it were not for legacy reasons ToString() would also return the normalized version. The design here was that going forward everything would be normalized, since SemVer2 is new, all of those should be normalized. |
The issue here is that V2 endpoints (OData) currently have the behavior of always returning the original version string as-is in the Version property. For SemVer2 packages, that would be a call to To not break that behavior, an easy-to-access OriginalVersion property would come in really useful. |
Just discovered another inconsistency: I noticed that e.g. |
There's no reliable way to get a hold of the original, unmodified version string used to construct a
NuGetVersion
instance.NuGetVersion.ToString()
returns normalized version string for SemVer2 versions, and original version string for non-SemVer2 versions.NuGetVersion.ToFullString()
returns normalized version string + metadata (e.g. when original version was"01.0.42.0"
, this will return"1.0.42"
, which is not the original version string).Simply exposing the
_originalString
field through a readonly public property would allow the caller to get a hold of the original version string.The text was updated successfully, but these errors were encountered: