[Mono-list] Problem when loading embedded resources

Gonzalo Paniagua Javier gonzalo@ximian.com
20 Jul 2003 11:38:12 +0200


El s?, 19-07-2003 a las 17:13, Giuseppe Greco escribió:
> 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?

Mmm. If it works under MS and fails with mono, it's a bug. May be you
can file a bug report with a test case that helps us reproduce the bug
and, hopefully, fix it.

-Gonzalo