473,327 Members | 1,976 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Unable to find embedded resource



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
2 8658
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


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Nils Erik Asmundvaag | last post by:
Hello I hope someone is able to help me with this frustrating problem. I have a C# web project in Visual Studio .NET 2003. I want to support Swedish and Norwegian texts and have put the texts...
0
by: Mats | last post by:
Hello everyone ! I am using Crastal Reports for VS.Net and I have an assembly with several projects in one of them I have two Crystal reports. Although they worked fine for weeks and I haven't...
1
by: james | last post by:
What class / method should I be using to get the full path to an embedded resource ? In my case I have an .xml file that my app uses, it is set as embedded resource, and I have a control that...
3
by: Craig | last post by:
Hi I'm creating a web control whereby I use a resource file to store strings for property descriptions and so forth. The namespace for the control is: Unsd.Web.WebControls all classes in the...
1
by: n! | last post by:
I have an irritating problem with VS.NET2003, C#. I wrote some code that would build my application menu from an XML resource file. Purely to make it easy for me to edit, so I've added this file as...
2
by: Kyle Kaitan | last post by:
I have an assembly (AppResources.dll) which contains a number of embedded resource files. Most of these are key/value pairs of relevant strings; a few are images and sounds; some more are XML...
1
by: TRI_CODER | last post by:
I am trying to solve the following exception. The exception occurs when my ASP.NET code behind code attemtps to access a remore site using SSL. Please note that all certificates are valid and the...
4
by: Jason Pettys | last post by:
In an ASP.NET project I am setting the content type of my .ascx and ..aspx files to Embedded Resource for a separate reason. When I do this they get embedded as "RootNamespace.Filename" but I...
3
by: raghu sunkara | last post by:
Hi, How Can i Change or Modify Embedded String Resource In An Assembly. I Need To Modify Embedded String Resource In An Assembly. Please Help Me. Thanks Raghu.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.