.net Globalization and ResourceManager
- by Andrew Bullock
I've got a console app and i need to globalize some of the hardcoded message strings.
I've got two assemblies:
MyProgram.Console (Console app)
MyProgram.Core (class lib)
In MyProgram.Core I've made a Language.en-GB.resx and set it as an Embedded Resource.
In the resource I've created a key/value pair:
"SomeKey" : "SomeValue"
When I build my application I get:
bin/MyProgram.Console.exe
bin/MyProgram.Core.dll
bin/en-BG/MyProgram.Core.resources.dll
How do I address these resource key/values? Currently I'm trying this from a class within MyProgram.Core:
var mgr = new ResourceManager(GetType().Assembly.GetName().Name, Assembly.GetExecutingAssembly());
mgr.GetString("SomeKey", new Culture("en-GB"));
But I keep getting:
System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "MyProgram.Core.resources" was correctly embedded or linked into assembly "MyProgram.Core" at compile time, or that all the satellite assemblies required are loadable and fully signed.
What am I doing wrong? I've tried every combination I can think of for the baseName argument to the ResourceManagers ctor.
Thanks