Matthew Scharley
Matthew Scharley

Reputation: 132284

Deleting Visual Studio binary output folders automatically?

I just got through manually removing the bin\ and obj\ folders from around 30 VS projects getting them ready for an initial SVN commit. Yeah, I know, I should have done it alot sooner, but these are personal project on my home PC, and I only installed a SVN server locally today.

Anyway, it occurs to me that there must be some easier way to clean out these folders, an option in Visual Studio, or an external tool, something... Does anyone have any suggestions, since I still have a few solutions left to do?

Upvotes: 0

Views: 617

Answers (4)

Ateş Göral
Ateş Göral

Reputation: 140060

What happens when you do a "clean" on your solution or project files? You could do a clean before adding your project files to SVN.

Another thing you could try is to add exclusion rules to your SVN repository.

You could even create a new build target (call it "SVN Prep" for instance) that does nothing but run a post-build task that clears your files via a batch file or Windows script.

A method I sometimes apply is to use an advanced file manager like Total Commander to manually delete the files with just a few steps. I "explode" all the folders to see all the files in a flat view (CTRL-B), sort the files by extension and then delete all the build artifacts.

Upvotes: 0

tsimon
tsimon

Reputation: 8010

A non-SVN specific option that can be applied to a few more situations is to use WinRar. Create a zip of your project structure, and then one of the menu options is to view the archive in 'flat folders' view. This removes the hierarchy and shows all of the files.

This can be useful in a number of ways, such as sharing files with coworkers. You can sort the files by type, look up all the .dlls and remove all of the common libraries you use to reduce the size. Or you can sort by date, and remove all .cs files that have not been changed in the last week, etc.

Upvotes: 0

X-Cubed
X-Cubed

Reputation: 1899

VisualSVN automatically creates svn:ignore rules for binary and user-specific folders, as soon as you add a solution to Subversion.

Upvotes: 0

Christian C. Salvadó
Christian C. Salvadó

Reputation: 827496

You can use svn:ignore to avoid committing unnecessary files...

Upvotes: 4

Related Questions