diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/FileContent.cs index f5199de1c13a..849e22b27741 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 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 fee72034781f..3d4972b5637b 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 from packages.config files using the NuGet CLI."); + 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} 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}"); + } + assemblyLookupLocations.UnionWith(nugetPackageDllPaths.Select(p => new AssemblyLookupLocation(p))); } catch (Exception exc)