mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
C#: Make sure System.Private.CoreLib is added only once as a reference in standalone extraction
This commit is contained in:
@@ -100,6 +100,18 @@ namespace Semmle.BuildAnalyser
|
||||
dllDirNames.Add(runtimeLocation);
|
||||
}
|
||||
|
||||
if (options.UseMscorlib)
|
||||
{
|
||||
// Add mscorlib.dll or System.Private.CoreLib.dll to the list of DLLs to reference.
|
||||
var loc = typeof(object).Assembly.Location;
|
||||
var dir = Path.GetDirectoryName(loc);
|
||||
if (dir != null)
|
||||
{
|
||||
progressMonitor.Log(Util.Logging.Severity.Debug, $"Adding folder {dir} to DLL search path.");
|
||||
dllDirNames.Add(dir);
|
||||
}
|
||||
}
|
||||
|
||||
// These files can sometimes prevent `dotnet restore` from working correctly.
|
||||
using (new FileRenamer(sourceDir.GetFiles("global.json", SearchOption.AllDirectories)))
|
||||
using (new FileRenamer(sourceDir.GetFiles("Directory.Build.props", SearchOption.AllDirectories)))
|
||||
@@ -122,11 +134,6 @@ namespace Semmle.BuildAnalyser
|
||||
|
||||
ResolveConflicts();
|
||||
|
||||
if (options.UseMscorlib)
|
||||
{
|
||||
UseReference(typeof(object).Assembly.Location);
|
||||
}
|
||||
|
||||
// Output the findings
|
||||
foreach (var r in usedReferences.Keys)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user