C#: Disregard _._ dependencies and only default to use an entire framework in case the compile section is empty.

This commit is contained in:
Michael Nebel
2023-11-13 13:11:31 +01:00
parent e89fe8ddde
commit 890cba6e95
2 changed files with 19 additions and 12 deletions

View File

@@ -100,16 +100,18 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
return;
}
// If this is a .NET framework reference then include everything.
if (FrameworkPackageNames.AllFrameworks.Any(framework => name.StartsWith(framework)))
if (info.Compile is null || !info.Compile.Any())
{
dependencies.AddFramework(name);
}
else
{
info.Compile?
.ForEach(r => dependencies.Add(name, r.Key));
// If this is a framework reference then include everything.
if (FrameworkPackageNames.AllFrameworks.Any(framework => name.StartsWith(framework)))
{
dependencies.AddFramework(name);
}
return;
}
info.Compile
.ForEach(r => dependencies.Add(name, r.Key));
});
return;