[Mono-list] Problem when loading embedded resources

Gonzalo Paniagua Javier gonzalo@ximian.com
20 Jul 2003 13:34:48 +0200


El dom, 20-07-2003 a las 12:35, Giuseppe Greco escribió:

> Gonzalo, before enter a bug report, consider the following.

Anyway, please, add this information to the bug report.

> 
> My assembly is defined as culture neutral, but has been localized
> to four languages. The .NET documentation says that the directory
> layout of *.resources files is very import... they should be organized
> like this:
> 
> bin
>   + en-US
>   |   + myassembly.resources
>   + de-DE
>   |   + myassembly.resources
>   + fr-FR
>       + ...
> 
> The exception described above occurs because my assembly is
> culture neutral, but the default resources have been
> compiled into the en-US directory (if I compile the default
> resource into the top directory, it does function also with
> Mono on Linux).
> 
> The ResourceManager class should be able load the most
> compatible resources, isn't it? 

Mmmm. And how do we know that we should choose en-US instead of de-DE?
My bet is that MS defines CultureInfo.CurrentCulture to be en-US and
that's why it finds the resources. Try changing your culture to be
another one that is not in the list of resources and you'll probably get
an error...

Currently mono does not set the culture that the user has. It uses the
invariant culture, afair.

-Gonzalo