Reputation: 256711
My Visual Studio solution has two sets of resources with different persistence types:
There seems to be a bug in Visual Studio 2010 where i cannot select resources from the embedded in resx set:
How do i convince Visual Studio 2010 to let me use resources in the project?
Of course i could set the images at runtime:
public ImportNSAKnownTerroristsListForm()
{
InitializeComponent();
toolStripButton1.Image = Properties.AvatarSharedResources.NewDocument;
}
But i'm not willing to do that.
Embedded Resources
Embedded resources are the best choice if you have to share application resource (.resx) files between multiple projects. For example, if you have a common resource file that contains your company's logos, trademark information, and such, using embedded resources means you have to copy only the .resx file and not the associated resource data files.
Update: Embedded in .resx
resource in different folder (per Hans' musing):
Update: Someone edited my title to
This is incorrect, as that would lead to duplicated titles, rather than the correct:
But i need to not get into a pissing match with a troll.
Upvotes: 4
Views: 5501
Reputation: 256711
The answer is that a shared resx
file (and designer) must be in the "root" folder.
Anyplace else and VS will not find it.
Upvotes: 6