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

[Problem/Bug]: System.Globalization.CultureNotFoundException when InvariantGlobalization true in .csproj #4831

Open
jpalmowski opened this issue Sep 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jpalmowski
Copy link

What happened?

We have a .NET 8 console application that ultimately spawns a WebView2 Control within a WinForm

We've recently set <InvariantGlobalization>true</InvariantGlobalization> in our .csproj to deal with System.Text JSON deserialization issues,

Since this has been released we've been seeing the following in our logs

System.Globalization.CultureNotFoundException
Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'culture')
3081 (0x0c09) is an invalid culture identifier.

Stack trace:

System.Globalization.CultureInfo.GetCultureInfo(Int32 culture):92
System.Windows.Forms.InputLanguage.get_LanguageTag():203
System.Windows.Forms.InputLanguageChangedEventArgs..ctor(InputLanguage inputLanguage, Byte charSet):23
System.Windows.Forms.InputLanguage.CreateInputLanguageChangedEventArgs(Message m):16
System.Windows.Forms.Control.WmInputLangChange(Message& m):46
System.Windows.Forms.Control.WndProc(Message& m):1035
Microsoft.Web.WebView2.WinForms.WebView2.WndProc(Message& m):58
System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam):42

We aren't explicitly attempting to set any culture info on the WebView2 control

Can someone confirm if this a supported configuration?

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

No response

Framework

Winforms

Operating System

Windows 10, Windows 11

OS Version

No response

Repro steps

We don't have clear steps to reproduce but this is affecting multiple different clients and their devices.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

@jpalmowski jpalmowski added the bug Something isn't working label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant