R – Stuck with localization using resource files

asp.net-mvcembedded-resourcelocalization

I have a very weird problem with resx based localization.
At first, let me explain, how it is done for me right now.
It is ASP.NET MVC project. I have two assemblies: web and domain. Web contains all MVC related stuff, and domain, well, contans domain classes. Also, in domain assembly I store a lot of static resources for localization(I am building site with 3 different languages available).

So I have Localization folder in this domain assembly and there are files like:
CheckoutStrings.resx, CheckoutStrings.en-US.resx, CheckoutStrings.et-EE.resx and so on.

Now the weird thing is that this is all working really nicely on my local machine using both VS Developing Server and IIS 7.5. But when I upload solution to my web server, which is Windows Server 2008 R2, so it is IIS 7.5 as well, my localization suddenly stops working.

I tried to output

Thread.CurrentThread.CurrentUICulture

in my views, just before outputting localized strings.
It gives me selected culture, which is right, but nevertheless strings are rendered as a fallback value, not localized one.

I am really stuck here, hope anyone has a clue what is going on…

Best Answer

Could it be that the localization files are simply not found and you are falling back to the "default language"? Are you maybe deploying into GAC on the server but running it from a /bin folder with subfolders on your dev machine? Have you tried using fuslogvw.exe to see where the code comes from?

Be aware that to see the loads of satellite assemblies you have to do some registry "hacks" - http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx :

To log bind failures to satellite assemblies Set the HKLM\Software\Microsoft\Fusion\LogResourceBinds registry value to 1 (the value is a DWORD).

Related Topic