Configure Visual Studio to show error messages in English

后端 未结 9 1038
清歌不尽
清歌不尽 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.

提交回复
热议问题