Anders Forsgren
Anders Forsgren

Reputation: 11101

How to completely avoid localized .NET exception messages

When an error occurs in my .NET applications, i get an exception message in (in my case) swedish. This is useless for most purposes because.

[1] I'm not joking. Example: "Calling assembly" in the context of a binding failure is completely obfuscated. It is translated to "called assembly" because of how english uses the same word for the one that is calling as for the one it is calling. Almost as if someone used a dictionary to translate it word by word.

So what I want: I want to be able to get english exception messages, consistently, on a non-english windows install (I do not want to change the thread culture of the application).

There is a similar question ( Exception messages in English? ) , but that is in the concept of logging. On that level I could just change the thread culture.

But I want the change to be global, and include "not my code" exceptions as well.

Is there any way this can be configured or "hacked" (e.g. by replacing resource files)? Am I the only person thinking that translating exception messages to begin with, is a horrible design flaw in .NET?

I'm sorry if this was part rant and part question.

Upvotes: 45

Views: 6855

Answers (2)

Icen
Icen

Reputation: 451

On windows 10 you can do this but you need to change display language.

language setup

Then you need to set back your date time settings

date setup

You will have system in English but for most programmers that doesn't matter.

Upvotes: -1

Expro
Expro

Reputation: 143

Remove any .NET language packs. According to this ("The .NET Framework 4.5 Language Pack contains translated error messages and other UI text for languages other than English. If you don't install a language pack, this text is displayed in English"), it should be enough.

Upvotes: 4

Related Questions