From d694b5a71e96033dbd77a9e542c7d7b3ec075c03 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 59db4d3b6f9..5c4d9f58de6 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 = new List(); + 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)