Folks, is there any smart way to easily find unused files in entire solution? My project was consolidated by previous developer and it gained size at least 3x. I'd like to shrink the size of project but I cannot find quick and easy way. Any advices?
-
1Use Resharper trial version and do cleanup files. Check the Redundancies in the Code section under Inspection Severity in the Resharper Options – Kiru Apr 16 '12 at 14:23
-
Seems like a great tool. Unfortunately my company does not allow to install trial versions of software. – Darj Apr 16 '12 at 14:39
-
Possibly useful [SO thread](http://stackoverflow.com/q/5665979/304683) – EdSF Apr 16 '12 at 15:05
4 Answers
This open source project might be a good place to start. It's meant to filter out unused images, but it should be pretty easy to change so it looks for unused files.

- 53,710
- 19
- 160
- 149

- 45,496
- 8
- 73
- 110
How about writing a program to do it? Could be a neat little project for a junior dev to write for you.

- 1,136
- 2
- 10
- 30
I think finding unused code is a job for a static analysis tool. As @kiru mentioned, Reshareper has this functionality and it is easy to use. They also offer a 1-month trial version.

- 13,229
- 5
- 34
- 50
-
This is not about the code, but files. Amount of code is correct, but there are too much files like images, unused scripts, etc... I want to remove them so project would shrink a bit. – Darj Apr 16 '12 at 14:41
The extension in the selected answer above only works in vs2012 while Code Maid works in vs2010 - vs2014:
There is a free extension called Code Maid that "is an open source Visual Studio extension to cleanup, dig through and simplify our C#, C++, F#, VB, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding." Does images as well.

- 872
- 15
- 32