C# – Read values from satellite assemblies using ResourceManager

clocalizationresourcemanagersatellite-assembly

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.

Best Answer

  • 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