18

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?

3 Answers 3

25

This is a quick visual guide on removing the imported resources to Resources.resx.

  • Right click your project from Solution Explorer
  • Choose Properties
  • Choose Resources
  • Select image to remove
  • Click "Remove Resource"

enter image description here

enter image description here

1
  • 1
    Nor does this work for removing image resources in VS2017 Commented Jul 31, 2018 at 11:42
10

You should select the resource in the resource grid and click Remove Resource, as described in this MSDN article.

2
  • I knew something like that must exist, I just couldn't find it. Thanks.
    – sieben
    Commented Jan 22, 2011 at 15:51
  • 1
    This does not work for removing image resources. Certainly not in VS2017 Commented Jul 31, 2018 at 11:42
1

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.

1
  • (Using VS2017). Commented Feb 5, 2019 at 8:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.