diff --git a/src/NuGetGallery/Services/PackageDeprecationManagementService.cs b/src/NuGetGallery/Services/PackageDeprecationManagementService.cs index c24a9c9456..53e2e9ec38 100644 --- a/src/NuGetGallery/Services/PackageDeprecationManagementService.cs +++ b/src/NuGetGallery/Services/PackageDeprecationManagementService.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -148,7 +148,7 @@ public async Task UpdateDeprecation( foreach (var version in versions) { var normalizedVersion = NuGetVersionFormatter.Normalize(version); - var package = packages.SingleOrDefault(v => v.NormalizedVersion == normalizedVersion); + var package = packages.SingleOrDefault(v => StringComparer.OrdinalIgnoreCase.Equals(v.NormalizedVersion, normalizedVersion)); if (package == null) { return new UpdateDeprecationError( @@ -181,4 +181,4 @@ await _deprecationService.UpdateDeprecation( return null; } } -} \ No newline at end of file +} diff --git a/tests/NuGetGallery.Facts/Services/PackageDeprecationManagementServiceFacts.cs b/tests/NuGetGallery.Facts/Services/PackageDeprecationManagementServiceFacts.cs index 20b424c8f7..4170717547 100644 --- a/tests/NuGetGallery.Facts/Services/PackageDeprecationManagementServiceFacts.cs +++ b/tests/NuGetGallery.Facts/Services/PackageDeprecationManagementServiceFacts.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -856,7 +856,7 @@ private async Task AssertSuccessful( var package2 = new Package { - NormalizedVersion = "1.0.0", + NormalizedVersion = "1.0.0-RC1", PackageRegistration = registration }; @@ -932,7 +932,7 @@ private async Task AssertSuccessful( var service = GetService(); - var packageNormalizedVersions = new[] { package.NormalizedVersion, package2.NormalizedVersion }; + var packageNormalizedVersions = new[] { package.NormalizedVersion, package2.NormalizedVersion.ToLowerInvariant() }; // Act var result = await InvokeUpdateDeprecation( @@ -981,4 +981,4 @@ private static Task InvokeUpdateDeprecation( } } } -} \ No newline at end of file +}