Resx sharing between projects

I have a solution called "mySolution" with two projects:

  • Projecta
  • Projectb

ProjectA contains a resource file named 'mySolutionResources.resx'.
ProjectB refrences projectA, but cannot access resources in mySolutionResources.

After some research, I found that: "resource classes are marked as internal."

Now my question is:

If I want to save only one 'mySolutionResources.resx', how can I do to access it from projectB? If this is not possible, is there another approach?

+6
source share
2 answers

If you open "mySolutionResources.resx" (in the designer), and on top you will see the Access Modifier: [Internal] option. You can change this value to [Publish] . This should provide resource data to other projects, if specified.

+7
source

Instead of sharing resx files, I would rather write code in one assembly to expose resources from the outside (depending on the nature of the resources). If you do not want this common code to be publicly available, you can always use InternalsVisibleTo

+1
source

Source: https://habr.com/ru/post/953179/


All Articles