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

[vs17.9] Ensure no IOException/SecurityException is thrown when setting console output/input encoding #9837

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Mar 7, 2024

Backport of #9833 to vs17.9

Fixes AB#1985518

Summary

PR #8503 added the custom language setting detection by env var DOTNET_CLI_UI_LANGUAGE as well as console output/input encoding settings on OSes that support UTF-8. This is also applied to FileLogger which is used by C++ Console project. Because devenv is a GUI process, setting console output/input encoding is not available and throws IOException. Then Building C++ Console project with VS fails with Error: The handle is invalid.

To fix this, when setting console output/input encoding is not available catch IOException/SecurityException but do nothing.

Customer Impact

It blocks building C++ Console project with VS when setting env var DOTNET_CLI_UI_LANGUAGE.

Regression?

Yes, building C++ Console project with VS 17.8.7 works well, but fails in 17.9.0.

Testing

Tested with VS 17.9.2 by deploying msbuild with this fix.
FixCplusplusConsole

Risk

Low

@github-actions github-actions bot requested a review from a team as a code owner March 7, 2024 11:18
@JanKrivanek JanKrivanek merged commit 12dc7cd into vs17.9 Mar 8, 2024
8 checks passed
@JanKrivanek JanKrivanek deleted the backport/pr-9833-to-vs17.9 branch March 8, 2024 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants