Force exceptions language in English

前端 未结 7 1828
孤城傲影
孤城傲影 2020-12-08 00:35

My Visual Studio 2005 is a French one, installed on a French OS. All the exceptions I receive during debug or runtime I obtain also in French.

Can I howev

相关标签:
7条回答
  • 2020-12-08 00:52

    For the good of all future users of your application, place this to the Main method:

    CultureInfo.DefaultThreadCurrentUICulture = Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
    

    It will save them a good lot of trouble finding the English equivalent of a a badly translated error message.

    0 讨论(0)
  • 2020-12-08 01:03

    I didn't try, but according to the documentation that property should be set by default to the current UI language, that is set in the control panel. So it should work correctly automagically according to your international settings.

    0 讨论(0)
  • 2020-12-08 01:04

    For any Win8/8.1 users facing this issue, installing the English Language Pack and make it the Windows display language seems to be only easy way to resolve it as Win8 has .net framework built in its core.

    Probably the same for Win10.

    0 讨论(0)
  • 2020-12-08 01:06

    This is known problem. Please vote for fix here: Exception Handling / Error Logging in English

    Old Link on Microsoft Connect which has since been decommissioned.

    0 讨论(0)
  • 2020-12-08 01:11

    Uninstall the French language pack:

    Start - Control Panel - Programs and Functions - Microsoft .NET Framework (4 Client Profile) Language Pack FRU - Uninstall

    You may need to repeat the uninstallation for each version of .NET Framework that you find there.

    0 讨论(0)
  • 2020-12-08 01:12

    You could set the current culture to English only in debug builds :

    #if DEBUG
    Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
    #endif
    
    0 讨论(0)
提交回复
热议问题