Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

resx sharing between projects

Tags:

c#

.net

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

  • ProjectA
  • ProjectB

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 ?

like image 578
Juan Pablo Gomez Avatar asked Sep 04 '13 16:09

Juan Pablo Gomez


2 Answers

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.

like image 60
PazDev Avatar answered Sep 19 '22 20:09

PazDev


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

like image 22
Нет войне Avatar answered Sep 19 '22 20:09

Нет войне