0

I've a problem with serialization both in silverlight and asp.net.

I've added this line to my web.config to set the culture of my web application:

<globalization uiCulture="fr-CA" culture="fr-CA"/> 

Problem: when my computer is set to another culture for example en-UK, my application is taking that culture instead of the one i set in the web.config.

1
  • en-UK is invalid en-GB is correct. Not related to the problem though. Commented Aug 7, 2013 at 11:14

1 Answer 1

1

Your site might be honoring the browser's stated language preference.

Check the Language settings in the browser, and try setting enableClientBasedCulture in your web.config to false, per this MSDN article.

Also worth making sure you try other basic troubleshooting steps, like resetting IIS (assuming you're not using the built-in Visual Studio development web server).

If those steps fail, I would roll up my sleeves and try some serious debugging. It's possible something else is overriding your setting, or that ASP.NET isn't finding your .resx resource file.

Try overriding the InitializeCulture method on a page and hardcoding the language there (assuming you're using Webforms). That will also let you set a breakpoint while the page is loading and check what the UICulture is set to.

If the cultures are getting set properly, I'd look to make sure everything is set up correctly with your .resx. Those things can be a pain to get configured in my experience.

It might be a good idea to set up a simple HelloWorld demo app to try to reproduce and isolate the problem. Here's a decent walk-through so you can check your setup steps.

Sign up to request clarification or add additional context in comments.

1 Comment

I've used InitializeCulture and it works thanks :) I've tested UICulture and it wasn't set to the culture I need. It seems that the settings in the web.config only set the default language not the language to use, so the the app takes the system culture.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.