简体   繁体   English

C# WinForm 应用程序在切换键盘语言时崩溃(文化 ID XXXX (0xYYYY) 不是支持的文化)?

[英]C# WinForm application crashing (Culture ID XXXX (0xYYYY) is not a supported culture) when switching keyboard language?

I use Visual Studio 2005 to create an empty C# WinForm application where only Form1 is showing.我使用 Visual Studio 2005 创建一个空的 C# WinForm 应用程序,其中仅显示 Form1。 Whenever I run it, either from within Visual Studio or by double-clicking the.exe-file, and then switch language on my keyboard I get the following exception and my application crashes:每当我运行它时,无论是在 Visual Studio 中还是通过双击 .exe 文件,然后在我的键盘上切换语言,我都会收到以下异常并且我的应用程序崩溃:

Culture ID 9216 (0x2400) is not a supported culture.文化 ID 9216 (0x2400) 不是受支持的文化。 Parameter name: culture参数名称:文化

If I debug it from Visual Studio, then the exception happens in Program.cs on the following line:如果我从 Visual Studio 调试它,则异常发生在 Program.cs 中的以下行:

Application.Run(new Form1());应用程序.运行(新 Form1());

How can I solve this in my application ?如何在我的应用程序中解决这个问题? I don't want to switch to a newer .NET Framework and I don't want to have to make changes on all the computers this application is running on.我不想切换到更新的 .NET 框架,也不想在运行此应用程序的所有计算机上进行更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM