How to remove unused Resources?

Asked

Viewed 1,405 times

2

Is there any way or extension of Visual Studio that makes it possible to search for unused Resources in the application?

2 answers

3


The solution I found was to use the RESX Utils.

As this solution was not working properly, few modifications to the source code solved the problem.

The applied solution:

RESX Utils uses only the resource key as a search parameter, so I changed to use it this way: namespaceResx.nomeClasseResx.keyResx;

With this, it correctly searches all selected files as filter on the main screen.

0

You can use the Resharper of Jetbrains, but the process is not fully automated.

1- Access the Resources.Designer.Cs class 2- Within this class there will be a Property for each resource of your project, just right click on each one and go to "Find usages" or "Find usages Advanced" 3- If no reference is found, you can exclude the resource.

With this method you can use Visual Studio’s own search as well, if you don’t find any record you can delete the resource.

  • It was from this exaggerated work that I was running. As there are several resource files, this process would take too long.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.