Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find Unused Resources in a .NET Solution

Tags:

.net

resources

How do you go about finding unused icons, images, strings in .resx files that may have become 'orphaned' and are no longer required?

like image 703
mrpbody Avatar asked Oct 29 '08 06:10

mrpbody


3 Answers

Recently ResXManager 1.0.0.41 added a feature to show the number of references to a string resource.

Screenshot showing the new reference column

like image 136
hultqvist Avatar answered Nov 09 '22 13:11

hultqvist


I couldn't find any existing solution that would search for string resource references in XAML files and batch-remove unused ones.

So I wrote this: https://github.com/Microsoft/RESX-Unused-Finder

RESX Unused Finder screenshot

It searches a project directory for references to string resources, then displays a list of ones it couldn't find a match for. You can specify a template to search for so it can find references in XAML files.

like image 21
RandomEngy Avatar answered Nov 09 '22 15:11

RandomEngy


I created a free open-source VS extension that looks for unused images in a project, just published the first version: https://marketplace.visualstudio.com/items?itemName=Jitbit1.VSUnusedImagesFinder

like image 11
Alex from Jitbit Avatar answered Nov 09 '22 15:11

Alex from Jitbit