[Mono-list] Problem when loading embedded resources

Giuseppe Greco giuseppe.greco@agamura.com
20 Jul 2003 11:45:01 +0200


On Sun, 2003-07-20 at 11:38, Gonzalo Paniagua Javier wrote:
> 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.

OK, I'll do that immediately.
Gius_.

> 
> -Gonzalo
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
-- 
----------------------------------------
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
----------------------------------------