views:

375

answers:

1

Hi Can somebody tell me how to read values from satellite assemblies using resourcemanager. I have an application MyApplication which will contain all the resource files. Now I have to read the values of these resources in my another application (ABC app). Can somebody tell me how can i do it.

A: 
  • Make sure the resource files (resx) are set to public rather than internal (in properties).

  • Set the namespace to the one you want to use for each file (again in properties).

(A class will be dynamically created so that you can refer to the resources in your code.)

  • Add a reference to the satellite assembly from the project that will be consuming it.

You can then refer to the strings using the Namespace you specified in the properties (Intellisense can really help you here!). Eg. Resources.SomeSpace.Somefile.Someresourcestring

UpTheCreek
I have tried the solution you told but it is not working.rx = new ResourceManager("MyResource", Assembly.GetExecutingAssembly());MyResource is the class name and I also referred the assembly after making it public to my calling app. Now when i try to use GetString it throws exception-Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "MyResource.resources" was correctly embedded or linked into assembly "ConsoleApplication1" at compile time, or that all the satellite assemblies required are loadable and fully signed.
Punit