On Jul 13, 10:43*am, steve <s_j_b...@yahoo.comwrote:
I have the following routine for retrieving error message strigs from a resource file which is embedded in the project. But when it
is called I get the error messsage "Could not find any resources.." shownunderneath the code.
The error message indicates that it is looking for resource ResourceExceptions.resource which is not what was embedded in the code
by Visual Studio. The resource file is ResourceExceptions.resx.
If I try to change the resource name to .resources VS complains I that I should not do this as I may corrupt something.
Does anyone have any idea how to fix this.
Thanks,
Steve
Code :
* * internal static class ResourceControl
* * {
* * * * private static ResourceManager rm;
* * * * public static string GetString(string key)
* * * * {
* * * * * * if (rm == null)
* * * * * * {
* * * * * * * * System.Reflection.Assembly myAssembly =System.Reflection.Assembly.GetExecutingAssembly() ;
* * * * * * * * rm = new ResourceManager("ResourceExceptions", myAssembly);
* * * * * * }
* * * * * * return rm.GetString(key);
* * * * }
* * }
Error Mesage
Could not find any resources appropriate for the specified culture or theneutral culture. *Make sure "ResourceExceptions.resources"
was correctly embedded or linked into assembly "Graphics2D" at compile time, or that all the satellite assemblies required are
loadable and fully signed.
Make sure that in the properties for your .resx file in the Solution
Explorer, "Custom Tool" property is set to "ResXFileCodeGenerator".