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!

NormalizedVersion is not normalized



  • When I query ProGet with a normalized version, it returns no package, however if I query it with the full version, it works.

    In other words, ProGet is not normalizing versions as it should.

    Using a nuget.org connector, if I query ProGet with:
    /Packages?$filter=tolower(Id) eq 'nsubstitute') and (NormalizedVersion eq '1.7.2')
    it returns:
    <?xml version="1.0" encoding="utf-8"?><feed xml:base="http://ushdc1-csdapp02.saig.frd.global/nuget/Default/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"><title type="text">Packages</title><id>http://ushdc1-csdapp02.saig.frd.global/nuget/Default/Packages()/</id><updated>2017-06-22T16:21:43Z</updated><link rel="self" title="Packages" href="Packages" /></feed>

    On the other hand, if I query it with a trailing zero:
    /Packages?$filter=tolower(Id) eq 'nsubstitute') and (NormalizedVersion eq '1.7.2.0') it returns:
    <?xml version="1.0" encoding="utf-8"?><feed xml:base="http://ushdc1-csdapp02.saig.frd.global/nuget/Default/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"><title type="text">Packages</title><id>http://ushdc1-csdapp02.saig.frd.global/nuget/Default/Packages()/</id><updated>2017-06-22T16:22:54Z</updated><link rel="self" title="Packages" href="Packages" /><entry><id>http://ushdc1-csdapp02.saig.frd.global/nuget/Default/Packages(Id='NSubstitute',Version='1.7.2.0')</id><title type="text">NSubstitute</title><summary type="text"></summary><updated>2017-06-22T16:11:21Z</updated><author><name>Anthony Egerton,David Tchepak</name></author><link rel="edit-media" title="Package" href="Packages(Id='NSubstitute',Version='1.7.2.0')/$value" /><link rel="edit" title="Package" href="Packages(Id='NSubstitute',Version='1.7.2.0')" /><category term="NuGet.Server.DataServices.Package" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><content type="application/zip" src="http://ushdc1-csdapp02.saig.frd.global/nuget/Default/package/NSubstitute/1.7.2.0" /><m:properties xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><d:Version>1.7.2.0</d:Version><d:Title></d:Title><d:RequireLicenseAcceptance m:type="Edm.Boolean">false</d:RequireLicenseAcceptance><d:Description>NSubstitute is a friendly substitute for .NET mocking frameworks. It has a simple, succinct syntax to help developers write clearer tests. NSubstitute is designed for Arrange-Act-Assert (AAA) testing and with Test Driven Development (TDD) in mind.</d:Description><d:ReleaseNotes></d:ReleaseNotes><d:Summary></d:Summary><d:ProjectUrl>http://nsubstitute.github.com</d:ProjectUrl><d:IconUrl>http://nsubstitute.github.com/images/nsubstitute-100x100.png</d:IconUrl><d:LicenseUrl>https://github.com/nsubstitute/NSubstitute/raw/master/LICENSE.txt</d:LicenseUrl><d:Copyright></d:Copyright><d:Tags>mocking mocks testing unit-testing TDD AAA</d:Tags><d:Dependencies></d:Dependencies><d:IsLocalPackage m:type="Edm.Boolean">true</d:IsLocalPackage><d:Created m:type="Edm.DateTime">2017-06-22T16:11:21.8100000Z</d:Created><d:Published m:type="Edm.DateTime">2017-06-22T16:11:21.8100000Z</d:Published><d:PackageSize m:type="Edm.Int64">849090</d:PackageSize><d:PackageHash>vDAfItA5TW9c597wvDuLM74K4C2Wh7zSjxHPNeRHkb906dc0wWc6myOub24JpS8ev3kw9QswLO0lMpyxzHagnw==</d:PackageHash><d:IsLatestVersion m:type="Edm.Boolean">true</d:IsLatestVersion><d:IsAbsoluteLatestVersion m:type="Edm.Boolean">true</d:IsAbsoluteLatestVersion><d:IsProGetHosted m:type="Edm.Boolean">true</d:IsProGetHosted><d:IsPrerelease m:type="Edm.Boolean">false</d:IsPrerelease><d:IsCached m:type="Edm.Boolean">false</d:IsCached><d:NormalizedVersion>1.7.2.0</d:NormalizedVersion><d:Listed m:type="Edm.Boolean">true</d:Listed><d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm><d:HasSymbols m:type="Edm.Boolean">false</d:HasSymbols><d:HasSource m:type="Edm.Boolean">false</d:HasSource><d:DownloadCount m:type="Edm.Int32">0</d:DownloadCount><d:VersionDownloadCount m:type="Edm.Int32">0</d:VersionDownloadCount></m:properties></entry></feed>

    According to NuGet's normalized version specification, the normalize version should omit trailing zeros from the fourth part of version numbers.

    A zero in the fourth part of the version number will be omitted

    What I could guess is that NormalizedVersion is just an alias for Version

    Product: ProGet
    Version: 4.7.13



  • This was a breaking change NuGet team made in NuGet 3.4 (I think). We did not want to not implement, as the change would impact a lot of our customers who rely on the quirks of "non-normalized" versions.

    So, as a compromise, the NuGet team implemented a searching strategy in the client to try a normalized version of the number (like 0.0.0.0), and then try non-normalized version (0.0.0) if not found.

    At this time, you'll need to do the same for your searches; if we ever decide to implement the normalized version, this strategy will be backwards compatible.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation