resources and dll ??

M

mathieu

Hi, I was wondering what is the best way to include resource in
library. I saw an example with a library which only contained one
class (Person) and the resources file associated with it (Person.resx
and Person.en.resx). But what if my library contains 50 classes ?? Is
there a way to put all resources for a library in one file per
language? If so how can it be done, what is the name of the resource
file.

thanks
mathieu
 
G

Guest

Hi

you are basically looking for satellite assemblies.

check the below links which shows you how to create satellite assemblies
http://samples.gotdotnet.com/quickstart/aspplus/doc/resourcefiles.aspx#satellit

http://www.developer.com/net/vb/article.php/10926_3083921_

Hope this helps.

Regards
Madh

MVP | MCSD.NE

----- mathieu wrote: ----

Hi, I was wondering what is the best way to include resource i
library. I saw an example with a library which only contained on
class (Person) and the resources file associated with it (Person.res
and Person.en.resx). But what if my library contains 50 classes ?? I
there a way to put all resources for a library in one file pe
language? If so how can it be done, what is the name of the resourc
file

thank
mathie
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,
Is there a way to put all resources for a library in one file per
language?

Definitely yes. Create an assembly resource file and store all the resources
there.
If so how can it be done, what is the name of the resource
file.

Anything you want it to be. Your task will then be to determine the actual
name to pass to the ResourceManager constrcutor. This name usually is
constructed like this:

<namespace>.<chosen-name>

So if your namespace is "Foo.Bar.CoolApp" and you've named the file
"Strings.resx", the name you should supply to ResourceManager is

Foo.Bar.CoolApp.Strings

For other languages, create additional resource files called like:

Strings.fr-FR.resx

These will be compiled into sattellite assemblies and retrieved
automatically given the sattellite assemblies are deployed to the correct
location and the desired culture is set as the value of the CurrentUICulture
property of the current thread.
 

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