Skip to content

Commit

Permalink
Merge pull request #15881 from tamasvajk/buildless/fix-fallback
Browse files Browse the repository at this point in the history
C#: Deduplicate not yet restored package names
  • Loading branch information
tamasvajk authored Mar 12, 2024
2 parents dddba32 + b07b076 commit be2ce17
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,18 @@ private void DownloadMissingPackages(List<FileInfo> allFiles, ISet<string> dllPa
return;
}

var multipleVersions = notYetDownloadedPackages
.GroupBy(p => p.Name)
.Where(g => g.Count() > 1)
.Select(g => g.Key)
.ToList();

foreach (var package in multipleVersions)
{
logger.LogWarning($"Found multiple not yet restored packages with name '{package}'.");
notYetDownloadedPackages.Remove(new(package, PackageReferenceSource.PackagesConfig));
}

logger.LogInfo($"Found {notYetDownloadedPackages.Count} packages that are not yet restored");

var nugetConfigs = allFiles.SelectFileNamesByName("nuget.config").ToArray();
Expand Down

0 comments on commit be2ce17

Please sign in to comment.