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 AppFabric.tv 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.

AppFabric.tv - CleanProject - Cleans Visual Studio Solutions For Uploading or Email

CmdLine

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

SNAGHTMLad8e3e

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

CleanProjvs.png

Windows Shell Folder Command

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

shellfolder

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
https://www.ronjacobs.com
Twitter: https://twitter.com/ronljacobs

Comments

  • Anonymous
    July 24, 2011
    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 pause

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

  • Anonymous
    July 25, 2011
    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.

  • Anonymous
    July 25, 2011
    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.

  • Anonymous
    July 25, 2011
    one of the programs that make everyday life easier

  • Anonymous
    August 18, 2011
    Very Nice.  Thank you for sharing!