Prevent exception messages from being translated into the user's language?

后端 未结 5 1729
遇见更好的自我
遇见更好的自我 2020-12-14 00:41

How do I make my application always use English when displaying win32/.net exceptions messages?

I got this message, it looks like someone used babelfish to translate

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 01:10

    If it's an ASP.NET application, you can set the UI language in web.config (*):

    
        
    
    

    For other applications, the current user's regional settings are used by default, and you have to explicitly override it - e.g. Thread.CurrentUICulture = new CultureInfo("en-US").

    (*) caveat - if an error in the config file results in an exception being thrown before the element is processed, you'll get the default uiCulture.

提交回复
热议问题