Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the crash in the Terminal Logger during shutdown. #10163

Merged
merged 1 commit into from
May 24, 2024

Conversation

AR-May
Copy link
Member

@AR-May AR-May commented May 21, 2024

Fixes #9662

Context

When we use TL, we save the console output encoding to a variable, change the encoding
to UTF8 for the logging duration and attempt to set it back to the previous value during the Terminal Logger shutdown. It fails in some terminal emulators. It seems to be either a bug of the terminal emulator or Console.OutputEncoding property.

Changes Made

Wrapped the setting of the console output in try-catch block.

Testing

Unit tests

@AR-May AR-May merged commit 72f42c4 into dotnet:main May 24, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: .NET 9.0 Alpha build fails in Windows 1809 Docker containers with Terminal Logger error
3 participants