Resource manager problem: naming for embedded resource.

D

Dirc Khan-Evans

I am trying to localise my app using embedded resource
and sattellite assemblies.

I can get it working using the following if I have a resource
file with the same name as the class:

ResourceManager resourceManager =
new ResourceManager(this.GetType());

However, I want to use a global resource for my assembly.
I have tried using the following with a resource file called
Strings.resx:

ResourceManager resourceManager =
new ResourceManager("Strings", this.GetType().Assembly);

I have also messed around setting the Custom Tool Namespace
but cannot get this working either.

As far as I can tell I am following the documentation, but
I can't get this to work.... I know it's going to be a
simple answer.. so could someone please put me out of my misery!

I'm certain it's down to the naming convention used but I don't get it
from the documentation.


Thanks in advance

Dirc

--
 
K

Karl Seguin

it should be NAMESPACE.Strings

so if the default namespace of your c# project is MyWebApp

it should be "MyWebApp.Strings"

to get the currently assembly, you should also do
System.Reflection.Assembly.GetExecutingAssembly

To find out the default namspace, right click on the project and goto
properties..it's in the first tab I think.

If you want a different (and better) way to deal with localized content,
check out:
http://openmymind.net/index.aspx?documentId=3
http://openmymind.net/index.aspx?documentId=4

and there's a part 3 coming soon :)

Karl
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top