Skip to content

Commit 1bf2bd8

Browse files
committed
Fix issues
1 parent a462838 commit 1bf2bd8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

plugins/csharp/parser/src_csharp/Program.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ private static async Task ParseSolutionPathAsync(
385385
if (projectPaths.Count == 0)
386386
{
387387
Console.Error.WriteLine($"No C# projects found in solution: {solutionPath}");
388-
return;
388+
throw new InvalidOperationException(
389+
$"No C# projects found in solution: {solutionPath}");
389390
}
390391

391392
await ParseProjectsByPathAsync(projectPaths, csharpConnectionString, threadCount);
@@ -457,7 +458,7 @@ private static async Task ParseProjectsByPathAsync(
457458
try
458459
{
459460
Console.WriteLine($"Fallback loading project: {projectPath}");
460-
var workspace = CreateMsBuildWorkspace();
461+
using var workspace = CreateMsBuildWorkspace();
461462
var project = await workspace.OpenProjectAsync(projectPath);
462463
await ParseProjectAsync(
463464
project,
@@ -518,7 +519,7 @@ private static async Task<Solution> LoadInputAsync(string inputPath)
518519
private static async Task<Solution> LoadSolutionAsync(string solutionPath)
519520
{
520521
Console.WriteLine($"Loading solution: {solutionPath}");
521-
var workspace = CreateMsBuildWorkspace();
522+
using var workspace = CreateMsBuildWorkspace();
522523

523524
var solution = await workspace.OpenSolutionAsync(solutionPath);
524525
Console.WriteLine($"Solution loaded: {solution.FilePath}");
@@ -529,7 +530,7 @@ private static async Task<Solution> LoadSolutionAsync(string solutionPath)
529530
private static async Task<Solution> LoadProjectAsync(string projectPath)
530531
{
531532
Console.WriteLine($"Loading project: {projectPath}");
532-
var workspace = CreateMsBuildWorkspace();
533+
using var workspace = CreateMsBuildWorkspace();
533534

534535
var project = await workspace.OpenProjectAsync(projectPath);
535536
Console.WriteLine($"Project loaded: {project.Name}");

0 commit comments

Comments
 (0)