如何将资源添加到自定义资源文件,而不将它们放在Visual Studio的默认“Resources”文件夹中

时间:2015-10-04 14:15:35

标签: visual-studio-2013 dll resources

如何将资源添加到自定义资源文件(.resx),而不将它们放在默认的“Resources”文件夹中。

这是我的设置的屏幕截图

enter image description here

然后我将图像添加到ToolbarImageResources.resx,这会按预期发生。资源将传递到默认的“Resource”文件夹中。 大多数时候我们不希望这种情况发生。

enter image description here

如果我们要从Resource文件夹移动图片并将其放入ToolbarImageResources文件夹,您会看到此错误消息Error 24 Resource 'ne2' could not be loaded because the file to which it is linked could not be found: YourPath\Resources\SettingsIcon.png. YourPath\ToolbarImageResources.resx 0 0

对于此示例,我们如何确保资源可以放入ToolbarImageResource文件夹而不会抛出错误

1 个答案:

答案 0 :(得分:1)

首先,将资源添加到自定义文件夹。 然后通过从自定义文件夹中选择它来将其添加为资源。