From 3e26ff2724e0c9535f8299c0a0eb6c559c6ac8f9 Mon Sep 17 00:00:00 2001 From: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com> Date: Wed, 10 Jul 2024 11:00:00 -0700 Subject: [PATCH] Resolve bug in CSharp Parser (#8594) --- .../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)