From 1b200da61839378f049fb827a6eb6802dd29c5f9 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu Date: Tue, 9 Jul 2024 17:32:04 -0700 Subject: [PATCH] Resolve bug in CSharp Parser --- .../parsers/csharp-api-parser/CSharpAPIParser/Program.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/apiview/parsers/csharp-api-parser/CSharpAPIParser/Program.cs b/tools/apiview/parsers/csharp-api-parser/CSharpAPIParser/Program.cs index 59db4d3b6f96..c29b9d7ce0b8 100644 --- a/tools/apiview/parsers/csharp-api-parser/CSharpAPIParser/Program.cs +++ b/tools/apiview/parsers/csharp-api-parser/CSharpAPIParser/Program.cs @@ -99,8 +99,12 @@ static async Task HandlePackageFileParsing(Stream stream, FileInfo packageFilePa } } - dependencyFilesTempDir = await ExtractNugetDependencies(dependencies).ConfigureAwait(false); - var dependencyFilePaths = Directory.EnumerateFiles(dependencyFilesTempDir, "*.dll", SearchOption.AllDirectories); + IEnumerable dependencyFilePaths = null; + if (dependencies != null && dependencies.Any()) + { + dependencyFilesTempDir = await ExtractNugetDependencies(dependencies).ConfigureAwait(false); + dependencyFilePaths = Directory.EnumerateFiles(dependencyFilesTempDir, "*.dll", SearchOption.AllDirectories); + } var assemblySymbol = CompilationFactory.GetCompilation(dllStream, docStream, dependencyFilePaths); if (assemblySymbol == null)