By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,893 Members | 1,231 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,893 IT Pros & Developers. It's quick & easy.

Unable to find embedded resource

P: n/a


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.." shown underneath 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 the neutral 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.
Jul 13 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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".
Jul 13 '08 #2

P: n/a


I finally figured out that I need to put the assembly name in front of the resource file name. I.e. Graphics2D.ResourceExceptions in
the code. Graphics2D is the dll within which the resource lies.

Thanks anyway,

Steve
On Sun, 13 Jul 2008 02:43:28 -0400, steve <s_******@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.." shown underneath 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 the neutral 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.
Jul 13 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.