Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio.NET 2008 doesn't give me english exception-messages

In previous versions of VS.NET or the .NET framework, you got english exception messages by default. If you installed a 'language pack', you received exception messages in the language of that language pack.

Now, I'm working with an English VS.NET 2008 (no language packs have been installed) on a dutch Windows Vista.

When I'm developing, and I write some code that triggers an exception, the exception message that I receive, is in dutch (the language of my OS). I don't want it to be in dutch; I want it to be in English. (Reasons are obvious: easier to Google, and those translated error-messages are crap).

In VS.NET, my international settings are set to 'English', in Windows Vista, my regional settings are set to 'Dutch/Belgium'. How can I get English exception messages, without having to change anything to my regional settings in Windows?

like image 592
Frederik Gheysels Avatar asked Mar 02 '09 13:03

Frederik Gheysels


1 Answers

After some searching on Stackoverflow and other sites on the net, it seems that Windows Vista decides which language-packs should be installed, and there seem to be no way to uninstall those language-packages (in XP this was possible).

I do not have Vista Ultimate (which would allow you to install multiple language packs side by side).

So, what I've done now, is this:

I've created a custom conditional compile symbol (DEVELOPER), and in my application, I've this code:

#if DEVELOPER

Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("en-us");

#endif

I just need to make sure that, when I build my application for deployment, I do not include this conditional define ... (But, I can easily do this, since my application is under CI).

like image 192
Frederik Gheysels Avatar answered Oct 22 '22 04:10

Frederik Gheysels