locked
Incorrect cultureinfo read by resourcemanager RRS feed

  • Question

  • User-1837475696 posted

    Hi there,

    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.

    Monday, January 8, 2007 8:04 AM

Answers

  • User371668647 posted

    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?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 8, 2007 2:06 PM

All replies

  • User371668647 posted

    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?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 8, 2007 2:06 PM
  • User-1837475696 posted

    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.

    Wednesday, January 10, 2007 6:35 AM
  • User371668647 posted
    Did you put them in the en folder?  And, how are the files named (both the default resource file and the desired resource file)?
    Wednesday, January 10, 2007 8:18 AM
  • User-1837475696 posted

    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)!!

    Wednesday, January 10, 2007 1:49 PM