[Mono-list] Problem when loading embedded resources
Giuseppe Greco
giuseppe.greco@agamura.com
19 Jul 2003 17:13:55 +0200
Hi all,
To load a localized string, I've written a method like this:
public static string GetString(string name)
{
lock(typeof(RM)) {
if (resourceManager == null) {
resourceManager = new ResourceManager("Gekkota.Core",
(typeof(RM)).Assembly);
}
return resourceManager.GetString(name, null);
}
}
Well, when invoking the method above, I always get the following error:
Unhandled Exception: System.Resources.MissingManifestResourceException:
Could not find any resource appropiate for the specified culture or its
parents (assembly:Gekkota.Core)
in <0x00330> 00 System.Resources.ResourceManager:InternalGetResourceSet
(System.Globalization.CultureInfo,bool,bool)
in <0x00097> 00 System.Resources.ResourceManager:GetString
(string,System.Globalization.CultureInfo)
in <0x0009f> 00 Gekkota.Core.RM:GetString (string)
in <0x00056> 00 Gekkota.Core.Listener:set_BufferSize (int)
in <0x0005f> 00 Gekkota.Core.Tests.Receiver:Main ()
I've looked inside my assembly, and it does contain the resources
I'm trying to retrieve...
The culture of my assembly is neutral, and I provide strings localized
to English, German, French, and Italian.
Furthermore, the code above works fine with .NET on Windows.
Any idea?
Gius_.
--
----------------------------------------
Giuseppe Greco
::agamura::
phone: +41 (0)91 604 67 65
mobile: +41 (0)76 390 60 32
email: giuseppe.greco@agamura.com
web: www.agamura.com
----------------------------------------