What is the correct way to remove resource images from a VS project?

sieben picture sieben · Jan 22, 2011 · Viewed 25.7k times · Source

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?

Answer

user3437460 picture user3437460 · Feb 18, 2017

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