You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When dotnet core projects are restored, the dependency manager precisely tracks the referenced package folders. The fallback restore logic ignored the precise usage list and instead considered all subfolders in the restore location to be referenced, even though not all subfolders were added to the dependency list. This meant that packages downloaded in partially successful restores were available on disk, but not added to the dependency list by the normal restore process, and skipped by the fallback restore process. This commit fixes this problem by ensuring that the fallback restore logic doesn't consider all subfolders in the restore location to be referenced, but only those that were added to the dependency list by the normal restore process.
Copy file name to clipboardExpand all lines: csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs
+18-12Lines changed: 18 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ public HashSet<AssemblyLookupLocation> Restore()
109
109
if (checkNugetFeedResponsiveness && !CheckFeeds(out explicitFeeds))
110
110
{
111
111
// todo: we could also check the reachability of the inherited nuget feeds, but to use those in the fallback we would need to handle authentication too.
112
-
var unresponsiveMissingPackageLocation = DownloadMissingPackagesFromSpecificFeeds(explicitFeeds);
112
+
var unresponsiveMissingPackageLocation = DownloadMissingPackagesFromSpecificFeeds([], explicitFeeds);
113
113
return unresponsiveMissingPackageLocation is null
114
114
? []
115
115
: [unresponsiveMissingPackageLocation];
@@ -166,11 +166,11 @@ public HashSet<AssemblyLookupLocation> Restore()
166
166
.ToList();
167
167
assemblyLookupLocations.UnionWith(paths.Select(p => new AssemblyLookupLocation(p)));
168
168
169
-
LogAllUnusedPackages(dependencies);
169
+
var usedPackageNames = GetAllUsedPackageDirNames(dependencies);
170
170
171
171
var missingPackageLocation = checkNugetFeedResponsiveness
0 commit comments