Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 856
sieben Avatar asked Jan 22 '11 15:01

sieben


People also ask

How do I remove resources from my project?

Remove a resource assignment Tip: To remove a resource from a project, on the View tab, choose Resource Sheet. Select the resource, and then press the DELETE key.

How do you delete a VS project?

You could select the project you want to delete/close in the VS code and then click on "File" - Select "Close Folder". That should do the job. To permanently delete it from your system you could go to your storage folder and remove it from there as well. Hope this helps.

What is a resource file in Visual Studio?

Applies to: Visual Studio Visual Studio for Mac Visual Studio Code. Resource files are files that are part of an application but are not compiled, for example icon files or audio files. Since these files are not part of the compilation process, you can change them without having to recompile your binaries.

How do I remove a project from solution?

In Solution Explorer, select the project item you want to remove. On the Edit menu, click Remove. On the confirmation dialog, click Remove to remove the item from the project.


3 Answers

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

like image 64
user3437460 Avatar answered Oct 11 '22 18:10

user3437460


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

like image 42
Oded Avatar answered Oct 11 '22 16:10

Oded


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.

like image 43
Ron Maxwell Avatar answered Oct 11 '22 16:10

Ron Maxwell