From e2c74bdc554fa07dca1338ab3c6ec425972d3d3d Mon Sep 17 00:00:00 2001 From: Damian Maslanka Date: Tue, 20 Feb 2018 14:55:27 +0100 Subject: [PATCH] (GH-1397) Support local source repository. --- src/chocolatey/infrastructure.app/services/NugetService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index 7c0cbe4eee..fa5e77ca53 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -862,11 +862,12 @@ public ConcurrentDictionary get_outdated(ChocolateyConfig foreach (var packageName in packageNames) { - var latestPackage = packageManager.SourceRepository.GetPackages().Where(x => x.Id.ToLower() == packageName && x.IsLatestVersion).FirstOrDefault(); + // LastOrDefault to get the latest package from local repository, beacuse all packages have set IsLatestVersion to true + var latestPackage = packageManager.SourceRepository.GetPackages().Where(x => x.Id.ToLower() == packageName && x.IsLatestVersion).LastOrDefault(); if(latestPackage == null) { - this.Log().Warn(packageName + " doesn't exists in the current source."); + this.Log().Warn(packageName + " doesn't exist in the current source."); continue; }