C# 如何在调试时将 Visual Studio 异常消息语言更改为英语

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/529951/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 06:57:15  来源:igfitidea点击:

How to change Visual Studio exception message language to English while debugging

c#visual-studio-2005

提问by Oysio

I am working on machine with XP Dutch version installed on it. Visual studio 2005 is installed in English. I'm having the annoying problem while debugging that all .NET Framework exception message appear in Dutch, which make them really worthless. I tried to change this to English by setting the regional settings in the control panel to US English and then reinstalling the .NET Framework 2.0 (English version) but apparently this did not solve the problem. Does anyone have an idea?

我正在使用安装了 XP 荷兰语版本的机器。Visual Studio 2005 以英文安装。我在调试所有 .NET Framework 异常消息都以荷兰语显示时遇到了烦人的问题,这使它们变得毫无价值。我试图通过将控制面板中的区域设置设置为美国英语,然后重新安装 .NET Framework 2.0(英语版)来将其更改为英语,但显然这并没有解决问题。有没有人有想法?



I think my question was missunderstood, I don't want to change the current culture of the thread. The problem i'm having is when you are debugging and stepping through the code when suddenly one of those exception windows appears with the exception-message in it. This exception message appears in Dutch and I would like it to appear English. I hope this clarifies the question.

我认为我的问题被误解了,我不想改变线程的当前文化。我遇到的问题是,当您调试和单步执行代码时,突然出现其中一个带有异常消息的异常窗口。此异常消息以荷兰语显示,我希望它显示为英语。我希望这能澄清这个问题。

回答by Darin Dimitrov

This issue has been discussed here. Basically you can change the current thread's CurrentCultureto en-US.

这个问题已经在这里讨论。基本上,您可以将当前线程的CurrentCulture更改为 en-US。

回答by Oysio

I did some more research and apparently it is not possible to change the CurrentUICulture by default to a different language then the native language of the installed OS. It can only be changed when doing something like this in the code itself:

我做了一些更多的研究,显然不可能将 CurrentUICulture 默认情况下更改为与已安装操作系统的本地语言不同的语言。只有在代码本身中执行以下操作时才能更改它:

Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-us");

回答by Antoine Meltzheim

Solved !

解决了 !

No line of code.

没有一行代码。

Go to Start > Configuration Panel > Language and region > Administration > Languages for non unicode programs > Set it to english.

转到开始 > 配置面板 > 语言和区域 > 管理 > 非 unicode 程序的语言 > 将其设置为英语。