locked
trying to read from localization resource and get error message RRS feed

  • Question

  • User-416741251 posted

     hi

     

    I'm trying to read from resourcem when i run the project i'm getting the next message:

    Could not find any resources appropriate for the specified culture or the neutral culture.
    Make sure "WebApplication.App_GlobalResources.ResourceDaysLocalization.resources" was correctly embedded or linked into assembly "WebApplication" at compile time, or that all the satellite assemblies required are loadable and fully signed.

    i tried resgen.exe and al.exe but still i'm getting the same error message.

     

    Wednesday, September 30, 2009 8:26 AM

Answers

  • User-126244515 posted

    What is the name of your resource (.resx) file and what is the namespace of your application? In addition, it seems you're using two different methods of working with resources, in that you're saving to the App_GlobalResources folder, from which you can follow these guidelines, http://msdn.microsoft.com/en-us/library/ms227982.aspx. If you want to work with resource files in other folders, you can use the ResourceManager as you do, but in general this is rarely needed for ASP.NET applications.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 2, 2009 6:46 AM

All replies

  • User-126244515 posted

    How is the resource file used in the project? In which folder is it located, which type of resource file is it (.resx or...?), and is it a Web site or a Web application?

    Friday, October 2, 2009 4:21 AM
  • User-925286913 posted

    You need to add Global Resource files in App_GlobalResources and local resource files in App_LocalResources folder. These are special asp.net folder and you must use them to support multi language.

    Friday, October 2, 2009 4:30 AM
  • User-416741251 posted

     hi 

    I'm using the resource to convert checkbox text to a language that was selected by the user.

    the resource is located under the App_GlobalResources directory and the resource type is .resx

    i'm building web application.

    Friday, October 2, 2009 5:16 AM
  • User-126244515 posted

    Okay, what is the Build Action for the resource file (select in Solution Explorer and check in the Properties window)? Should typcally be set to Embedded Resource. How are you reading from the resource file?

    Friday, October 2, 2009 5:22 AM
  • User-925286913 posted

    I'm using the resource to convert checkbox text to a language that was selected by the user.

    How do you fetch the text?

    Friday, October 2, 2009 5:38 AM
  • User-416741251 posted

    I'm using the ResourceManager.

    Friday, October 2, 2009 6:02 AM
  • User-126244515 posted

    Cool, but can you please post the code for using the ResourceManager?

    Friday, October 2, 2009 6:16 AM
  • User-416741251 posted

    ResourceManager myResourceMgr = new ResourceManager("MyApplication.MyResource ", Assembly.GetExecutingAssembly());

    CheckbxDay1= myResourceMgr.GetString("sunday");

    and so on for all the other checkboxes, i'm trying to set the checkboxes days text according to

    the user culture.

    Friday, October 2, 2009 6:37 AM
  • User-126244515 posted

    What is the name of your resource (.resx) file and what is the namespace of your application? In addition, it seems you're using two different methods of working with resources, in that you're saving to the App_GlobalResources folder, from which you can follow these guidelines, http://msdn.microsoft.com/en-us/library/ms227982.aspx. If you want to work with resource files in other folders, you can use the ResourceManager as you do, but in general this is rarely needed for ASP.NET applications.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, October 2, 2009 6:46 AM
  • User-925286913 posted

    ResourceManager myResourceMgr = new ResourceManager("MyApplication.MyResource ", Assembly.GetExecutingAssembly());

    There is blank space after MyApplication.MyResource. So make it:

    ResourceManager myResourceMgr = new ResourceManager("MyApplication.MyResource", Assembly.GetExecutingAssembly());


    CheckbxDay1= myResourceMgr.GetString("sunday");

    Shouldn't it be CheckbxDay1.Text = myResourceMgr.GetString("sunday");?

    Friday, October 2, 2009 6:46 AM
  • User-925286913 posted

    Apart from this, you need not to store weekdaynames in resource files. You can get it with:

    new System.Globalization.CultureInfo(AdHosterUser.CommonHelper.Culture).DateTimeFormat.DayNames().GetValue(0); //for sunday

    Friday, October 2, 2009 6:54 AM
  • User-416741251 posted

    my resource name is days.resx, my application namespace is WebApplication and this is

    the name of the assembly too.

    the link you posted helps, thanks.

    Friday, October 2, 2009 7:34 AM