Why Microsoft has not fixed this bug in VS2010 and VS2012 is beyond me! But here's the issue...
When managing "images" for any Project within a Solution, you would think that simply Removing the item via the Resources Manager window in Visual Studio would do the trick. Not! Over time, we have added many pictures to our projects and now, there are many that are simply not in use. ANY ATTEMPT to remove the unused images from the project requires a SURGICAL approach because each image has to be deleted from THREE LOCATIONS!! -- The end result? == bloated .EXE.
Here's what really happens:
1. You attempt to remove the image from the Resources Manager of a given project.
2. The image REMAINS listed in the Resources folder of the Project within the Solution Explorer (e.g., on your hard drive). When you go to the physical Resources folder on your computer, the file that you supposedly "Removed" is STILL THERE?!!
3. There is an XML file that works with the Resources Manager and the <data> line items (for the image that you just deleted) IS STILL THERE?!!
FAILED ATTEMPTS:
We found a free Visual Studio extension that attempted to solve the problem but the coder did not take into account items #2 and #3.
SOLUTION REQUIREMENTS
Our VS solutions are composed of of MANY projects and each project contains MANY images used for the GUI and other things. Over time, after importing file after file, there now remains a LOT of images that are no longer used anywhere. We require a coder to design a bulletproof option (internal to Visual Studio OR external) that does the following:
1. Creates a LIST of all images used for a given project.
2. For each item in the LIST, searches the ENTIRE project for references to <namespace>.Properties.Resources.<image_name_without_file_extension>
3. For any items in the LIST that are NOT FOUND ANYWHERE IN THE PROJECT, DO THIS:
a) Remove it from the Resources Manager
b) Remove the entry from the .XML file
c) Delete the file from the Resources folder on the hard drive
WISH LIST:
It would be really nice if we could point the solution to this problem to the Visual Studio SOLUTION. If this poses a problem, then pointing the solution to an individual PROJECT (one at a time) would be sufficient.
To demonstrate that you have read the project requirements, please enter the word RESOURCES in your bid proposal.