Find unused resources in Silverlight or WPF with ResourceCounter

Is there a way to see what resources are not used in XAML?

I am currently working on a very interesting Silverlight Project for Philips Healthcare. Like all projects it is rapidly growing and it’s time for some cleaning up.

When you use Expression blend it’s easy to create static resources for everything you are going to re-use. Static resources are always loaded in Silverlight. Even if they are not used. Unfortunately Expression Blend does not have a way to get rid of unused resources. Last year I built a small WPF app that analyses your project for you and indicates unused static resources. I’ve used it again today and decided to share it with you.

ResourceCounter

Download and extract ResourceCounter.zip and run the exe. Enter a valid path to a Silverlight or WPF project and click ‘Analyse’

Resource counter

Written by Loek van den Ouweland on August 24, 2011. Questions regarding this artice? You can send them to the address below.