0

I have a solution that contains 2 winforms app and a classlibrary referenced by the 2 apps... I added some images in resource

resources from class library

but when I go on the winform app and try to add the image into a button appears this:

load resource

Is there a way to do this?

thanks

ghiboz
  • 7,863
  • 21
  • 85
  • 131
  • 1
    would [this post](https://stackoverflow.com/questions/24151524/how-can-i-share-resources-across-multiple-projects-within-a-c-sharp-solution) help? or may be [this one](https://stackoverflow.com/questions/1100455/issue-with-shared-winforms-resources-across-projects-in-visual-studio)? – Mong Zhu Sep 16 '20 at 09:39

1 Answers1

1

You have to make resource items public instead internal.

To do this, in .resx file in solution explorer select Property Window (Alt+Enter) and in File Properties -> Custom Tool should be ResXFileCodeGenerator

Change this option to PublicResXFileCodeGenerator (if option don't show in dropdown field, don't worry aboit it, write/type PublicResXFileCodeGenerator in field)

After that resources member class will be generated with public modifier and you can access to it from any project that reference assembly.

I hope it can help you!