Skip to content

Commit c3a4895

Browse files
authored
Avoid double disposal of terminal logger (#49969)
2 parents 35c0304 + 3017955 commit c3a4895

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ public override int Execute()
340340
}
341341

342342
BuildManager.DefaultBuildManager.EndBuild();
343+
consoleLogger = null; // avoid double disposal which would throw
343344

344345
return 0;
345346
}
@@ -356,7 +357,7 @@ public override int Execute()
356357
}
357358

358359
binaryLogger?.Value.ReallyShutdown();
359-
consoleLogger.Shutdown();
360+
consoleLogger?.Shutdown();
360361
}
361362

362363
static Action<IDictionary<string, string>> AddRestoreGlobalProperties(ReadOnlyDictionary<string, string>? restoreProperties)

0 commit comments

Comments
 (0)