|
Hi all,
I would like to embed some strings (SQL queries) into satellite assemblies. The reason for this is that the SQL queries might change but I don't want to recompile the entire application. So instead of creating a resx file and setting it's Build Action to "Embedded Resource" and adding the strings there I would like to place them in a satellite assembly (not compile them directly into the same dll that contains the code). This way all I need to do when a SQL query changes is replace this satellite assembly. Is it possible to have a satellite assembly with the culture neutral? I cannot set it to a different culture because that is misleading. However, I can't get it to work anyway.
My resources (called sTest1 and sTest2) are located in a resx file called "Strings.resx"
In order to generate the satellite assembly i first compile Strings.resx to Strings.resources using resgen.exe. After this I link it into dll <same_Name_as_dll_with_code>.resources.dll:
al.exe /target:lib /culture:neutral /keyfile:<key> /out:<same_Name_as_dll_with_code>.resources.dll /version:1.0.0.0 /embed: Strings.resources
The code that should read the satellite assembly resources is as follows (called inside the dll that uses the SQL queries):
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); System.Resources.ResourceManager satAssyReader = new System.Resources.ResourceManager("Strings", assembly);
string sTest1 = satAssyReader.GetString("test1"); string sTest2 = satAssyReader.GetString("test2");
After executing the program I get a good old MissingManifestResourceException. So my question: Is what I want to do possible at all? I'm not sure if satellite assemblies are designed for localization only. But I don't want to compile the resources into the dll with the code.
Thanks
ACKH
|