Problems using resources

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.

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!


Thanks in advance

Dirc
 
D

Dirc Khan-Evans

Dirc said:
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.

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!


Thanks in advance

Dirc



OK found the solution: Use the following:

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

--
 

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