question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception on keyboard layout switch with InvariantGlobalization

See original GitHub issue

.NET version

Microsoft.WindowsDesktop.App 7.0.5

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No response

Issue description

Unhandled exception. System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'culture')
1049 (0x0419) is an invalid culture identifier.
   at System.Globalization.CultureData.GetCultureData(Int32 culture, Boolean bUseUserOverride)
   at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride)
   at System.Windows.Forms.InputLanguage.get_Culture()
   at System.Windows.Forms.InputLanguageChangedEventArgs..ctor(InputLanguage inputLanguage, Byte charSet)
   at System.Windows.Forms.InputLanguage.CreateInputLanguageChangedEventArgs(Message m)
   at System.Windows.Forms.Control.WmInputLangChange(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ListView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)

Steps to reproduce

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
merriemcgawcommented, Jun 7, 2023

@OwnageIsMagic and @elachlan you guys did all the work for us 😸 . Thanks a ton!

1reaction
OwnageIsMagiccommented, Jun 2, 2023

@elachlan @DJm00n This issue can now be worked around by setting <PredefinedCulturesOnly>false</PredefinedCulturesOnly>. On WinForms side we can lazy init this property, since we store InputLanguage from which this property value comes. It’s not used internally. https://source.dot.net/#System.Windows.Forms/System/Windows/Forms/InputLanguageChangedEventArgs.cs,5bdc3016f89c5e99,references

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running .NET 6 project in Docker throws Globalization. ...
Your docker file should look like this for the base section: FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS base WORKDIR /app RUN apk ...
Read more >
Globalization config settings - .NET
Learn about run-time settings that configure globalization aspects of a .NET Core app, for example, how it parses Japanese dates.
Read more >
Ant Design Blazor/ant-design-blazor
Fixed ResizeObserver work incorrectly cause by wrong key type. #3030 @ElderJames ... Fixed Message that exception casue by Invariant Globalization setting.
Read more >
Net | PDF | Xml | Microsoft Visual Studio
Exception events. Garbage collection events. Interop events. Loader and binder events. Method events ThreadPool events. Type-system events
Read more >
Free Support Policies
Exception when Setting External Font Directory with Full Path under Linux ... Change the Shape/Form of a DataLabel in a Chart Using Aspose....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found