Latest Posts »
Latest Comments »
Popular Posts »

VS Add-In to locate unused files in a project

Written by praveen on May 23, 2008 – 7:34 pm

I’m not sure any of you guys have faced this problem but this has been a major issue for me on many of my projects. The problem I’m talking about is when you have that one file that you excluded from your project but forgot to delete from your hard drive and it somehow makes it to production without your knowledge! Or if you have an application that loads user controls at run-time or does http calls to other parts of the application at run-time. You made sure that you ‘excluded’ the file from your project but somehow it shows up. This could be applied to various kinds of files (think about overriding stylesheets).

The problem gets exacerbated when you’re working with a team and you merge your projects every now and then. Different team members work on multiple releases of the app (usually at the same time!) and team members include/exclude files over time. Then you have that big ‘merge party’ where you decide to merge all your branches. The problem arises when you try to merge project files. Many popular source control providers (hint: ahem, starts with a V) do not let you merge your project files. So what do you do? You just decide to use one of the several project files your team has been working on. So now you have a project with multiple files excluded (your team member didn’t like the way you implemented that class and excluded it;)) which were previously part of the project. The project compiles fine, however you have those old files lying on your disk. You use xcopy or some other utility to copy your files while creating your build package and boom, you have a file that’s not supposed to be there in your build.

You might argue why not just use the show/hide toggle on solution explorer. Well that would work well if you had a project with say 10-15 files but imagine enterprise level apps with 1000s of classes/files.

This add-in is a simple utility that lets you see what files are not part of your project. The program is still in Beta meaning it does not actually let you ‘clean’ your files but I promise to update it this weekend. Please feel free to provide feedback.
Download here


Tags: ,
Posted in .Net |

3 Comments to “VS Add-In to locate unused files in a project”

  1. Tim C Says:

    Hi there,

    Tried your plugin but was unfortunately unsuccessful. Issues I noticed were:

    - I have both VS2005 and VS2008. The plugin only appeared in VS2005

    - When I clicked on the ‘Clean Files’ menu option, no projects were shown in the left-hand pane even though I had a large solution loaded.

    Would be interested in trying an updated version if there is one!

    Cheers,

    TC

  2. praveen Says:

    Hi Tim,
    Thanks for your valuable feedback. I shall definitely take a look at the issues you pointed out and have a fix ready soon. I must admit the addin isn’t that user-friendly right now :D

  3. praveen Says:

    Hi Tim,
    The addin was not designed for 2008 but only 2005. To make it work for 2005, see if you can find the CleanFiles.addin file in your Documents and Settings folder. It should be in

    C:\Documents and Settings\YourUserName\My Documents\Visual Studio 2005\Addins

    If not, you can download it from the following location and copy to the above folder.
    http://praveensg.com/wp-content/uploads/2008/11/cleanfiles.addin

    Let me know if that works.

    Thanks,
    Praveen

Leave a Comment