Configure Visual Studio to show error messages in English

后端 未结 9 840
清歌不尽
清歌不尽 2020-12-05 01:29

I\'m currently working in another country, and my PC has a non-English version of Windows installed. I don\'t care about this, but I do care a lot when Visual Studio shows e

相关标签:
9条回答
  • 2020-12-05 02:01

    The best way would be to use this code in your application entry method

    if (Debugger.IsAttached)
        CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("en-US");
    

    It will force english messages not only in exceptions caught and displayed in the application but inside the IDE as well

    Because you cannot force your users to use english language versions of Windows when performing some initial tests on premises you may have find this useful.

    0 讨论(0)
  • 2020-12-05 02:01

    I didn't have any language packs in Visual Studio / Windows installed other than English. Still my application in IIS Manager > .NET Globalization > (UI) Culture showed another language than English. Running lpksetup in a cmd-window I was able to uninstall the language pack (Dutch in my case).

    source: https://blogs.msdn.microsoft.com/benjaminperkins/2013/03/01/creating-custom-language-specific-error-pages-in-iis/

    0 讨论(0)
  • 2020-12-05 02:04

    Deinstall the .NET Framework xxx Language Pack. (xxx = boring message language)

    0 讨论(0)
  • 2020-12-05 02:10

    In my case in Windows 10 it was as simple as going to Language Settings in Windows and changing the windows display language.

    I could have tried changing the DefaultThreadCurrentUICulture as described above in code but i feel this is wrong for multilanguage apps and really exception messages should stay in english so someone can google them and get help.

    0 讨论(0)
  • 2020-12-05 02:13

    As I posted in another thread, in my case it took only one line of code to change the Culture:

    System.Globalization.CultureInfo.DefaultThreadCurrentUICulture=System.Globalization.CultureInfo.GetCultureInfo("en-US");
    

    It changes default Culture of Main thread and new ones as well.

    0 讨论(0)
  • 2020-12-05 02:13

    1 . Deinstall the .net framework 2. go to preferences languages => region and languages => change language to your language that u want (windows 10)

    • this method its work for me
    0 讨论(0)
提交回复
热议问题