diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index 3a63b6bf09..4f7699f469 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -899,8 +899,7 @@ public ConcurrentDictionary get_outdated(ChocolateyConfig .AsQueryable(); } - // Call .ToList() to prevent warning from NuGet if package is not found in a remote repository - var latestPackage = results.OrderByDescending(x => x.Version).ToList().FirstOrDefault(); + var latestPackage = results.ToList().OrderByDescending(x => x.Version).FirstOrDefault(); if (latestPackage == null) {