Minor fixes in standalone extraction

This commit is contained in:
Tamas Vajk
2023-07-04 10:25:02 +02:00
parent 95ddc01ccb
commit ffc09c44c2
2 changed files with 6 additions and 2 deletions

View File

@@ -41,6 +41,8 @@ namespace Semmle.BuildAnalyser
}
}
private static readonly Version emptyVersion = new Version(0, 0, 0, 0);
/// <summary>
/// Indexes all DLLs we have located.
/// Because this is a potentially time-consuming operation, it is put into a separate stage.
@@ -55,7 +57,9 @@ namespace Semmle.BuildAnalyser
// Index "assemblyInfo" by version string
// The OrderBy is used to ensure that we by default select the highest version number.
foreach (var info in assemblyInfoByFileName.Values.OrderBy(info => info.Id))
foreach (var info in assemblyInfoByFileName.Values
.OrderBy(info => info.Name)
.ThenBy(info => info.Version ?? emptyVersion))
{
foreach (var index in info.IndexStrings)
assemblyInfoById[index] = info;

View File

@@ -100,7 +100,7 @@ namespace Semmle.Extraction.CSharp
// Figure out if it's dotnet core
var netCoreProjectFile = root.GetAttribute("Sdk") == "Microsoft.NET.Sdk";
var netCoreProjectFile = root.GetAttribute("Sdk").StartsWith("Microsoft.NET.Sdk");
if (netCoreProjectFile)
{