Problems using resources

  • Thread starter Thread starter Dirc Khan-Evans
  • Start date Start date
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
 
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);

--
 
Back
Top