Resources

  • Thread starter Thread starter Mystique
  • Start date Start date
M

Mystique

How can i read resources/strings from one EXE to another?

When I read from the current EXE I use:

ResMng = new ResourceManager("MyClient.Source.MyStringsEN",
Assembly.GetExecutingAssembly());

So I suppose it should be something like this:

ResMng = new ResourceManager("MyClient.Source.MyStringsEN",
Assembly.GetAssembly( ??? ));

I just don't know what to set for GetAssembly( ??? )

thx
 
Hi Mystique,

Not sure I entirely understand your question. I think you're asking how to
load resources from an assembly other than the currently executing one . . .
?

If so, all you need is a reference to the assembly from which you would like
to load resources. You can get this in one of these ways:

- Assembly.Load("name");
- typeof(ContainedType).Assembly;

The first mechanism relies on you knowing only the name of the assembly
containing the resources you would like to load. Don't worry about
performance issues. If the assembly has been loaded already, the Load()
method does not reload it - it simply returns a reference to the existing
Assembly object.

The second mechanism requires that you know a type defined in the assembly
containing the resources you would like to load. This approach will ensure
any errors are trapped at compile time. Of course, if you move the type you
refer to into another assembly, you're in trouble . . .

Regards,
Kent
 

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

Similar Threads

Resources in C# 4
Assembly Resource 2
Resource Manager Question 2
Localization issue... 1
Loading string resource from a file 16
Reading a Resource Stream 7
Resources and Folders in VS 1
VS2005 C# and Resources 2

Back
Top