mirror of
https://github.com/github/codeql.git
synced 2026-04-18 21:44:02 +02:00
C#: Use ASP.NET dlls when needed and available.
This commit is contained in:
@@ -63,12 +63,19 @@ namespace Semmle.BuildAnalyser
|
||||
|
||||
var dllDirNames = options.DllDirs.Select(Path.GetFullPath).ToList();
|
||||
|
||||
// Find DLLs in the .Net Framework
|
||||
// Find DLLs in the .Net / Asp.Net Framework
|
||||
if (options.ScanNetFrameworkDlls)
|
||||
{
|
||||
var runtimeLocation = new Runtime(dotnet).GetRuntime(options.UseSelfContainedDotnet);
|
||||
progressMonitor.Log(Util.Logging.Severity.Info, $"Runtime location selected: {runtimeLocation}");
|
||||
var runtime = new Runtime(dotnet);
|
||||
var runtimeLocation = runtime.GetRuntime(options.UseSelfContainedDotnet);
|
||||
progressMonitor.LogInfo($".NET runtime location selected: {runtimeLocation}");
|
||||
dllDirNames.Add(runtimeLocation);
|
||||
|
||||
if (UseAspNetDlls() && runtime.GetAspRuntime() is string aspRuntime)
|
||||
{
|
||||
progressMonitor.LogInfo($"ASP.NET runtime location selected: {aspRuntime}");
|
||||
dllDirNames.Add(aspRuntime);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.UseMscorlib)
|
||||
|
||||
@@ -159,12 +159,6 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
return netCoreVersion.FullPath;
|
||||
}
|
||||
|
||||
// Location of the newest ASP.NET Core Runtime.
|
||||
if (newestRuntimes.TryGetValue(aspNetCoreApp, out var aspNetCoreVersion))
|
||||
{
|
||||
return aspNetCoreVersion.FullPath;
|
||||
}
|
||||
|
||||
if (DesktopRuntimes.Any())
|
||||
{
|
||||
return DesktopRuntimes.First();
|
||||
@@ -173,5 +167,17 @@ namespace Semmle.Extraction.CSharp.Standalone
|
||||
// A bad choice if it's the self-contained runtime distributed in codeql dist.
|
||||
return ExecutingRuntime;
|
||||
}
|
||||
|
||||
public string? GetAspRuntime()
|
||||
{
|
||||
var newestRuntimes = GetNewestRuntimes();
|
||||
|
||||
// Location of the newest ASP.NET Core Runtime.
|
||||
if (newestRuntimes.TryGetValue(aspNetCoreApp, out var aspNetCoreVersion))
|
||||
{
|
||||
return aspNetCoreVersion.FullPath;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user