Help!? C# ResourceManager, .resx problem

Hey Guys,

i’m using VS.NET (C#) and are attempting to get my entire project multi-lingual.

Now, the problem i seem to be getting is that my resourcemanager doesn’t appear to be helpful at all…it simply just doesn’t latch on to the resource file (.resx)

now, the setup is like this:

got my .resx sitting>>

  • bin
    – en-GB
    —MyResources.en-GB.resx
    – en-AU
    —MyResources.en-AU.resx
    – da
    —MyResources.da.resx
    – de
    —MyResources.de.resx
    MyResources.resx

and the string is as this >>

ResourceManager rmThis = new System.Resources.ResourceManager("MyResources", System.Reflection.Assembly.GetExecutingAssembly());
string mstrTest = rmThis.GetString("lblSystemHelp", new System.Globalization.CultureInfo(2057));

and the error i keep getting is>>

Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure “MyResources.resources” was correctly embedded or linked into assembly “xxxxxx”. baseName: MyResources locationInfo: <null> resource file name: MyResources.resources assembly: xxxxxx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null

Anyways, it’s driving me absolutely nuts…oh…btw…this is a web application…not a thin application (or client application).

problem seems to be the basename but i can’t seem to find out which to use…

help?!?!?!?

Humour me by renaming each of your resources as follows:

bin\MyResources.resx -> bin\MyResources.resources.resx

bin\[lang]\MyResources.[lang].resx -> bin\[lang]\MyResources.resources.resx

I personally use satellite assemblies (the .resx files are compiled into dlls) for this but that’s the naming convention required for the .dlls and I’m guessing the .resx files may require a similar one. It took me a very frustrating afternoon to get it all working but it was worth it in the end.

thanks jianson…

finally, ran with the satelite assembly compiled in the end.

and you’re right, it was the naming conventions that screwed up my script…

thanks heaps