[英]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 框架,也不想在运行此应用程序的所有计算机上进行更改。
I think these links can help you solve your problem我认为这些链接可以帮助您解决问题
https://support.microsoft.com/en-us/topic/error-message-when-you-run-an-application-or-try-to-access-a-web-site-on-a-computer-that-has-a-particular-net-framework-2-0-software-update-installed-culture-name-culture-is-not-supported-e23d2e4b-7d56-d234-8834-6874108381da https://support.microsoft.com/en-us/topic/error-message-when-you-run-an-application-or-try-to-access-a-web-site-on-a-computer-具有特定网络框架-2-0-软件更新安装-文化名称-文化不支持-e23d2e4b-7d56-d234-8834-6874108381da
https://www.csharp-examples.net/culture-names/ https://www.csharp-examples.net/culture-names/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.