I’ve got a rather large solution with many projects in it. Ideally I’d like to create a Resources project that contains all the embedded icons I need throughout my application.
I’ve read articles where people are referencing them through code, but is it possible to get access to this project’s resources in the designer? In other words, I’d like to select the resources when clicking on the BackgroundImage property of a form in the designer.
If not, what sort of architecture should I consider when trying to decouple my resources from my main project? It’s probably not a smart idea to release a 100mb executable everytime I modify a line of code or two.
From the best I can tell, you can NOT manipulate resources from other assemblies in the designer. Only the one(s) from the current project.
Here’s how I would do it:
Create a Class Library Project. In the Library, Add | New Item | Resources File. Add the Resources (images, icons) to that file (ex: Resource1.resx). In a Class in that Library add public members that return the resources.
Now in your project reference the Class Library and now can programmatically set the resources at runtime.
But unfortunately you can’t use the designer. 🙁 However, by doing this you will not need to redistribute that dll if you don’t make any changes to the resources in it.