How to use resources from "Resx Embedded Resources"?

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 built-in resx set:

enter image description here

How do I convince Visual Studio 2010 to let me use resources in a project?


Of course, I could set the images at runtime:

public ImportNSAKnownTerroristsListForm() { InitializeComponent(); toolStripButton1.Image = Properties.AvatarSharedResources.NewDocument; } 

But I do not want to do this.


From MSDN:

Embedded Resources

Embedded resources are the best choice if you need to share application resource files (.resx) between multiple projects. For example, if you have a shared resource file that contains your company logos, trademark information, etc., using embedded resources means that you only need to copy the .resx file and not the associated resource data files.


Update: Embedded in .resx resource in another folder (for Hans perception):

enter image description here


Refresh . Someone edited my title

  • How to use resources from "Resx Embedded Resources"?

This is not true, as this will lead to duplicate headers, not a rule:

  • Visual Studio 2010: how to use resources from "Resx Embedded Resources"?
  • Visual Studio 2008: how to use resources from "Resx Embedded Resources"?
  • Visual Studio 2005: how to use resources from "Resx Embedded Resources"?

But I don’t need to join the pissing match with the troll.

+4
source share
1 answer

The answer is that the shared resx file (and the designer) should be in the root folder.

In any case, VS will not find it.

+6
source

Source: https://habr.com/ru/post/1381981/


All Articles