Last post Jan 10, 2007 01:49 PM by elgx
Jan 08, 2007 08:04 AM|elgx|LINK
We do have a problem using resource files in a .Net 1.1. environment. On our development machine everything works correct, but in our production-environment not.
What do we do:
In global asax:
Application["RM"] = new System.Resources.ResourceManager("intofun.resources.Strings", System.Reflection.Assembly.GetExecutingAssembly());
ResourceManager rm = (ResourceManager)HttpContext.Current.Application["RM"];
In our webpages:
CultureInfo culture = new CultureInfo("en");
string localString = rm.GetString("testkey", culture);
As said in our development environment correctly the value of the thekey from the "intofun.resources.Strings.en.resx" file (which all are enclosed as embedded resources in our webproject in VS 2003) which is "key in english".
Strangely in our production environment the value is not coming from expected "intofun.resources.Strings.en.resx" but keeps coming from "intofun.resources.Strings.resx" the fallback resourcefile. No matter which culture ("en-US", "en", "it")
we passthrough as parameter to GetString.
The only thing we could find so far was a suggestion by giving full file right to the ASP.Net account for the ASP.Net tempdiretory. But this was already the case.
Thanks in advance for your answers. Please help.
Jan 08, 2007 02:06 PM|stiletto|LINK
One of the issues we ran across when deploying a globalized app was that the resource dlls for auxillary languages weren't deployed automatically.
So, have you verified that the *.en.resx file is in the en folder in the bin directory in your production environment?
Jan 10, 2007 06:35 AM|elgx|LINK
In the deloyment these files were indeed NOT included. So we uploaded them to the production environment and subsequently restarted the web application to force reloading of the resource files.
Unfortunatly still the fallback resource is loaded, so the reason for the problem must be something else.
Anyway thanks for your answer so far.
Jan 10, 2007 08:18 AM|stiletto|LINK
Jan 10, 2007 01:49 PM|elgx|LINK
We (or to be honest, you in combination with time) fixed it!
You were completely right about the deployment of the files, but since the website uses page cache it took some time before the resource files were used in the pages.
Thank a lot again! Again a happy customer (and no more pizza for us tonight)!!