Problem using different resources

Dec 3, 2012 at 8:33 AM


I created a new MVVM light application and experience some problems with
WPF localization extension in Visual Studio 2010 Premium.

In the project i created a map called "Lang" and in that map I created "Lang.resx" and "Lang.en-US.resx". Lang.resx has acces modifier "internal" while Lang.en-US has "no code generated".

Now in the main window I put:


in the <Window> tag.

The problem is: it completely ignores the en-US design culture and only uses the resources from Lang.resx. In my App.xaml.cs I use the line "LocalizeDictionary.Instance.Culture = CultureInfo.GetCultureInfo("en-US");" in static App(){} to set the culture to "en-US" but when I run it, it still only uses the resources from "Lang.resx".

Any help would be appreciated, I really can't figure it out on my own. Thanks.

Dec 3, 2012 at 9:55 AM
Edited Dec 3, 2012 at 9:57 AM

Hi Dovogja,

its normal that only the main file (Lang.resx) has a code generator. The other files (en-US, fr, etc.) will be linked during compilation.

Is the Resource and the Window in the same Assembly? (VisitorRegistration)
If not, please change the access modifier to public.

How does your assembly.cs looks like?

Cheers, Bernhard

Dec 3, 2012 at 10:20 AM

Hi Bernhard,

Thank you so much for your reply, I found the solution in my AssemblyInfo.cs.

It contained the line:

[assembly: NeutralResourcesLanguage("en-US",

When I remove this everything seems to work fine, now it looks in the
Lang.en-US.resx the way i expect it to do.

Thank you for your help!

Cheers, Dovogja

Dec 3, 2012 at 10:22 AM
Edited Dec 3, 2012 at 10:27 AM

Yep, I expected this line in the assembly.cs... bad default settings :)

Hope everything works now!
If you need something just ask.