Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forcing English language exceptions in .NET framework

While working with ASP.NET MVC, I have noticed that exception messages issued by the .NET framework installed on my System are in German. I'd really prefer English messages, so I can post them on SO.

I know this has been asked before on SO, but strangely enough none of the suggested workarounds seem to work in my case. I have already tried the following:

  • switching my Windows system to an English locale and restarting Visual Studio
  • Setting Tools -> Options -> Environment -> International Settings -> Language to "English"
  • setting the thread locale to English right before the exception is thrown as follows:

    Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture ("en-US"); Thread.CurrentThread.CurrentUICulture=new CultureInfo("en-US");

    //call my faulty method...

So, how can I make the .NET framework issue English language exception messages? And is there any approach that does this on a per-solution or even system-wide basis?

Edit: The exception is thrown while excuting my unit tests. I am not sure if this is the reason setting the thread's culture had not effect.

like image 699
Adrian Grigore Avatar asked Apr 06 '09 13:04

Adrian Grigore


People also ask

How do I change the exception language in Visual Studio?

Go to Start > Configuration Panel > Language and region > Administration > Languages for non unicode programs > Set it to english.

What is .NET Framework in English?

The .NET Framework (pronounced as "dot net") is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until being superseded by the cross-platform .NET project.

Is .NET Framework being phased out?

NET framework isn't dead; it just won't be developed by Microsoft anymore. Many other organizations are committed to its continued use and development, including Xamarin and Unity. That said, there is a big question of what will happen to the apps written in . NET.


1 Answers

Uninstall the German language pack:

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

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

like image 80
tomsv Avatar answered Sep 20 '22 08:09

tomsv