From 02cf0c69d4a67649de49aa88d10c7df92121336d Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 26 Oct 2026 11:41:33 +0100 Subject: [PATCH 1/3] C#: Uncondionally log the number of Restore Nuget Dlls using nuget.exe and log non-excluded candidates as debug info. --- .../NugetPackageRestorer.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs index fee72034781f..a87940eab9d5 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs @@ -148,10 +148,9 @@ public HashSet Restore() .Where(path => IsPathInSubfolder(path, legacyPackageDirectory.DirInfo.FullName, "tools")) .ToList(); - if (nugetPackageDllPaths.Count > 0) - { - logger.LogInfo($"Restored {nugetPackageDllPaths.Count} NuGet DLLs."); - } + + logger.LogInfo($"Restored {nugetPackageDllPaths.Count} NuGet DLLs."); + if (excludedPaths.Count > 0) { logger.LogInfo($"Excluding {excludedPaths.Count} NuGet DLLs."); @@ -163,6 +162,13 @@ public HashSet Restore() } nugetPackageDllPaths.ExceptWith(excludedPaths); + + logger.LogInfo($"Using {nugetPackageDllPaths.Count} NuGet DLLs as dependency candidates."); + foreach (var path in nugetPackageDllPaths) + { + logger.LogDebug($"Using NuGet DLL as dependency candidate: {path}"); + } + assemblyLookupLocations.UnionWith(nugetPackageDllPaths.Select(p => new AssemblyLookupLocation(p))); } catch (Exception exc) From 78e0762d9d720700ea1ee42a4b243e152267b351 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Mon, 26 Oct 2026 11:52:43 +0100 Subject: [PATCH 2/3] C#: Add some logging related to project file content. --- .../FileContent.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs index f5199de1c13a..e9da5d53f9c0 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs @@ -240,6 +240,14 @@ private void DoInitialize() logger.LogDebug($"Failed to read file {file}, exception: {ex}"); } } + + logger.LogInfo("Finished reading project files."); + logger.LogInfo($"Legacy project structure usage detected: {isLegacyProjectStructureUsed}"); + logger.LogInfo($"ASP.NET usage detected: {useAspNetCoreDlls}"); + logger.LogInfo($"New project structure usage detected: {isNewProjectStructureUsed}"); + logger.LogInfo($"Windows Forms usage detected: {useWindowsForms}"); + logger.LogInfo($"WPF usage detected: {useWpf}"); + logger.LogInfo($"Implicit using namespaces detected: {useImplicitUsings}"); } [GeneratedRegex("(?", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline)] From 68735832199c61c54cc87dfc7ffea1eb93a5073e Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 27 Oct 2026 15:39:07 +0100 Subject: [PATCH 3/3] C#: Adjust logging messages and add a bit more context. --- .../FileContent.cs | 2 +- .../NugetPackageRestorer.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs index e9da5d53f9c0..849e22b27741 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs @@ -247,7 +247,7 @@ private void DoInitialize() logger.LogInfo($"New project structure usage detected: {isNewProjectStructureUsed}"); logger.LogInfo($"Windows Forms usage detected: {useWindowsForms}"); logger.LogInfo($"WPF usage detected: {useWpf}"); - logger.LogInfo($"Implicit using namespaces detected: {useImplicitUsings}"); + logger.LogInfo($"Implicit usings enabled: {useImplicitUsings}"); } [GeneratedRegex("(?", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline)] diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs index a87940eab9d5..3d4972b5637b 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs @@ -149,7 +149,7 @@ public HashSet Restore() .ToList(); - logger.LogInfo($"Restored {nugetPackageDllPaths.Count} NuGet DLLs."); + logger.LogInfo($"Restored {nugetPackageDllPaths.Count} NuGet DLLs from packages.config files using the NuGet CLI."); if (excludedPaths.Count > 0) { @@ -163,7 +163,7 @@ public HashSet Restore() nugetPackageDllPaths.ExceptWith(excludedPaths); - logger.LogInfo($"Using {nugetPackageDllPaths.Count} NuGet DLLs as dependency candidates."); + logger.LogInfo($"Using {nugetPackageDllPaths.Count} DLLs as dependency candidates from NuGet packages restored via the NuGet CLI based on packages.config files."); foreach (var path in nugetPackageDllPaths) { logger.LogDebug($"Using NuGet DLL as dependency candidate: {path}");