Juan Pablo Gomez
Juan Pablo Gomez

Reputation: 5534

resx sharing between projects

I have a solution named 'mySolution' with two projects:

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

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

My question now is:

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

Upvotes: 8

Views: 4097

Answers (2)

PazDev
PazDev

Reputation: 1027

If you open the 'mySolutionResources.resx' (in designer) and on top you will see option of Access Modifier: [Internal]. You can change this value to [Public]. This should expose the resource data to other projects if referenced.

Upvotes: 10

Нет войне
Нет войне

Reputation: 1139

Rather than sharing resx files, I would prefer to write code in one assembly to expose the resources externally (depending on the nature of the resources). If you don't want that 'sharing' code to be public, you could always use InternalsVisibleTo

Upvotes: 1

Related Questions