如何将资源添加到自定义资源文件(.resx),而不将它们放在默认的“Resources”文件夹中。
这是我的设置的屏幕截图
然后我将图像添加到ToolbarImageResources.resx
,这会按预期发生。资源将传递到默认的“Resource”文件夹中。
大多数时候我们不希望这种情况发生。
如果我们要从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
文件夹而不会抛出错误
答案 0 :(得分:1)
首先,将资源添加到自定义文件夹。 然后通过从自定义文件夹中选择它来将其添加为资源。