CleanProject – Cleans Visual Studio Solutions For Uploading or Email

You know those little tools you build to help in your development?  The ones that you slapped together in a hurry and might not work all the time but you put up with them because you don’t want to take the time to fix them?  Well CleanProject.exe is one of those tools that I’ve had for a long while.  Years ago I think I shared an earlier version of it but when I mentioned this tool in an episode of I had some people ask if they could get the tool.  I didn’t want to share it because it was far too fragile.  It had numerous bugs and I didn’t want to take the time to fix it.  Then I found that I needed to use CleanProject in the build for Microsoft.Activities.UnitTesting and so I did some work that I can now share with you. - CleanProject - Cleans Visual Studio Solutions For Uploading or Email


First I created a command line parser I call CmdLine.  I know the old joke is that everybody has to build a Command Line parser.  There are many of them out there but I didn’t have one that worked just the way I wanted so I created one.  You can use it by simply installing it with NuGet.  Now that I had a solid command line parser the rest was easy.

Clean Project


Clean Project is a utility that cleans Visual Studio project directories so you can quickly upload or email a zip file with your solution.

How many times have you wanted to send a project to a friend or upload it to a web site like MSDN Code Gallery only to find that your zip file has lots of stuff that you don't need to send in it making the file larger than it needs to be.

  • bin folder
  • obj folder
  • TestResults folder
  • Resharper folders

And then if you forget about removing Source Control bindings whoever gets your project will be prompted with errors about Source Control.
With Clean Project, I simply run it and get a nice clean folder or zip file that I can share without any of these issues. For more see What Files and Folders Does Clean Project Remove?

Email A Solution

Suppose I want to email a solution to my friend Sam. I've installed Clean Project and I've already got the solution open in Visual Studio.

  1. Select Tools / Clean, Remove Source Bindings and Zip Solution
  2. Attach the zip file and send the email


Windows Shell Folder Command

You can also invoke CleanProject from Windows Explorer by right clicking on a folder.


How Do I

How do I Install Clean Project?
How do I run Clean Project From the Command Line?
How do I run Clean Project From Visual Studio?
How do I run Clean Project from Windows Explorer?
How do I report a bug or suggestion?

Happy Coding!

Ron Jacobs

Comments (6)

  1. I have a better solution says:

    Create a batch file with this in it:

    del /s /ah /f *.suo

    del /s /f *.user

    del /s /f *.cache

    del /s /f *.scc

    del /s /f *.vssscc

    del /s /f *.vspscc

    del /s /ah StyleCop.Cache

    rd /s /q bin obj TestResults


  2. Nathan Palmer says:

    Nice work! By the way, the guy who's suggesting all the deletes. That works just fine, but it's not as convenient.

  3. Pierre-Alain Vigeant says:

    Unless the development team is not using source control or, worst, source safe, I don't see why you need such tool.

    Git has 'git clean'.

    Mercurial has 'hg purge'.

    And SVN has, through TortoiseSVN, the 'Delete unversioned files' menu.

    I'm unaware of TFS. Maybe this tool is required for TFS.

  4. Ron Jacobs says:

    Yes, there are many ways to accomplish these things.  Perhaps through some combination of source control tools and batch files you could do the same thing.  I needed this tool so I built it.

  5. Markus Bach says:

    one of the programs that make everyday life easier

  6. Joe Schneebaum says:

    Very Nice.  Thank you for sharing!

Skip to main content