msbuild/newc
Noah Gilson 9deb5b58fb
Detect .NET SDK & VSLANG Custom Language Settings & Apply To MSBuild (#8503)
Fixes #1596

Changes Made
SetConsoleUI now calls into a helper which sets the encoding to support non-en languages and checks if an environment variable exists to change the language to.

Testing
Setting DOTNET_CLI_UI_LANGUAGE=ja now changes msbuild correctly:
image

Doing a complicated build (aka building MSBuild) to use multiple threads shows other threads seem to use the same UI culture:

image

See that chcp remains the same after execution:
image

(Was set to 65001 temporarily but back to the original page before execution.)

Notes
Much of this code is a port of this code: dotnet/sdk#29755
There are some details about the code here.

[!] In addition, it will introduce a breaking change for msbuild just like the SDK.
The break is documented here for the sdk: dotnet/docs#34250
2023-05-12 10:58:37 +08:00
..
Program.cs Detect .NET SDK & VSLANG Custom Language Settings & Apply To MSBuild (#8503) 2023-05-12 10:58:37 +08:00
newc.csproj Detect .NET SDK & VSLANG Custom Language Settings & Apply To MSBuild (#8503) 2023-05-12 10:58:37 +08:00