从 VS 项目中删除资源映像的正确方法是什么?
我已通过 Visual Studio Designer 将图像导入到项目资源文件中。其中一些图像不再使用,我想删除它们。
但是,我之前尝试通过解决方案资源管理器删除图像文件,然后从 .resx 文件中删除相应的 元素来删除资源图像。然而,这会导致 VS 设计者陷入恐慌并开始抛出异常,说它找不到我刚刚删除的文件,即使它们没有在任何地方引用。
从资源文件中删除图像的正确方法是什么?
I have imported images through the visual studio designer to the projects resource file. Some of these images are no longer used and I want to remove them.
However, I've tried to remove the resource images before by deleting the image file through the solution explorer and then removing the corresponding <data>
element from the .resx file. However, this causes the VS designer to have a panic attack and start throwing exceptions saying it can't find the files I've just removed even though they are not referenced anywhere.
What is the a proper way of deleting images from the resource file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是有关将导入的资源删除到 Resources.resx 的快速视觉指南。
This is a quick visual guide on removing the imported resources to Resources.resx.
您应该在资源网格中选择资源,然后单击
删除资源
,如这篇 MSDN 文章。You should select the resource in the resource grid and click
Remove Resource
, as described in this MSDN article.单击“图像”或“背景图像”属性可显示控件的“选择资源”对话框。从列表中选择图像。选择“本地资源”下的“清除”按钮。选择“确定”关闭对话框。
Click on the Image or BackgroundImage property to show the Select Resource dialog for the control. Select the image from the list. Select the Clear button under Local Resource. Select Okay to close the dialog.