Help me please (Resources)

K

KMILO

Hello,

Thanks ins advance for reading my message

Im trying to use many .resx files for different webforms when I try to the project the following error appears:

Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "Site.resources" was correctly embedded or linked into assembly "Site". baseName: Site locationInfo: <null> resource file name: Site.resources assembly: Site, Version=1.0.1384.18527, Culture=neutral, PublicKeyToken=null

Anyone knows what could be happend, thanks for your help!!!

Thankfully,

KMILO
 
J

Javier Campos

The compiler automatically adds the default namespace and folder location to
the resource file, so when you add the resource to the ResourceManager
object, you should use the whole name.

For example, I have a project called "MyProject", whose default namespace is
"MyProject.Core". I added a "Localization.resx", the structure is:

Core <project name... default namespace = "MyProject.Core">
|- References
|- Other Project folders
|-Resources
| \- Localization
| \- Localization.resx
|
\Localization.cs

The route I have to give the ResourceManager when opening is:

"MyProject.Core.Resources.Localization.Localization"

Something like:

using System.Threading;
using System.Resources;

<add class definition here>
public static ResourceManager m_ResMan;


m_ResMan = new
ResourceManager("MyProject.Core.Resources.Localization.Localization",Assembl
y.GetExecutingAssembly());

Otherwise, if you want to know the exact name, look in the "obj/" folder
after compiling, there should a ".resources" file with the complete name
given by the compiler to that resource, in my case:
MyProject.Core.Resources.Localization.Localization.resources

Hope this helps,

Javier Campos
Virtual Media Systems, S.L.


KMILO said:
Hello,

Thanks ins advance for reading my message

Im trying to use many .resx files for different webforms when I try to the
project the following error appears:
Could not find any resources appropriate for the specified culture (or the
neutral culture) in the given assembly. Make sure "Site.resources" was
correctly embedded or linked into assembly "Site". baseName: Site
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top