Investigate preferred UI culture for analyzer-config diagnostics
AI-generated:
Version Used:
Roslyn PR #85776, xUnit v3 migration branch (commit 60d0ef48f9110d37108987b99ae32bbf6a1c8537).
Steps to Reproduce:
- Run the C# command-line compiler in-process with a non-English host UI culture.
- Supply
/preferreduilang:enand an analyzer config containing an invalid diagnostic severity. - Inspect the localized
InvalidSeverityInAnalyzerConfigwarning text.
Diagnostic Id:
InvalidSeverityInAnalyzerConfig
Expected Behavior:
The warning message should consistently follow the compiler's preferred UI language (/preferreduilang:en).
Actual Behavior:
The test infrastructure observed output matching either the preferred English resource or the host UI culture, and currently cannot explain which culture is used in all test-host configurations. The test is being pinned to en-US to avoid accepting two different outputs; investigate whether the compiler consistently applies PreferredUILang when formatting analyzer-config diagnostics or whether a culture-sensitive cache is involved.
Source: dotnet/roslyn