C#: Favor DLLs with most recent .NET Core target framework when resolving dependencies in standalone

This commit is contained in:
Tom Hvitved
2023-08-24 10:56:54 +02:00
parent f996fa2f8b
commit 554a2c26c3
3 changed files with 87 additions and 9 deletions

View File

@@ -59,10 +59,13 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
// The OrderBy is used to ensure that we by default select the highest version number.
foreach (var info in assemblyInfoByFileName.Values
.OrderBy(info => info.Name)
.ThenBy(info => info.NetCoreVersion ?? emptyVersion)
.ThenBy(info => info.Version ?? emptyVersion))
{
foreach (var index in info.IndexStrings)
{
assemblyInfoById[index] = info;
}
}
}