Skip to content

Commit a9ebb58

Browse files
[release/10.0.1xx-preview7] Avoid double disposal of terminal logger (#49970)
Co-authored-by: Jan Jones <[email protected]>
1 parent afb2f20 commit a9ebb58

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
@@ -273,6 +273,7 @@ public override int Execute()
273273
}
274274

275275
BuildManager.DefaultBuildManager.EndBuild();
276+
consoleLogger = null; // avoid double disposal which would throw
276277

277278
return 0;
278279
}
@@ -289,7 +290,7 @@ public override int Execute()
289290
}
290291

291292
binaryLogger?.Value.ReallyShutdown();
292-
consoleLogger.Shutdown();
293+
consoleLogger?.Shutdown();
293294
}
294295

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

0 commit comments

Comments
 (0)