

Workspace directory to get to a “clean” state, especially when someone That wipes out all of the “bin” and “obj” directories in the currentĭirectory and every subdirectory.

Here is William's version gci -inc bin,obj -rec | rm -rec -force It should be possible to run it from the root of the drive. This site: uses William Kempf's powershell commands to remove any bin and obj folders from the current directory and sub directories. This way you can enrich or fine-tune your extra-cleanup-logic centrally, in one place without going through the pains of manually editing each and every *.csproj file by hand every time you want to make an improvement. If you are into optimizing the maintainability of your solutions you might want to take things one step further and place the above snippet into a separate file like so: Īnd then include this file at the very end of each and every one of your *.csproj files like so: I have it enabled because I noticed that in some third party projects it causes issues when files ala nfig exist inside the. You may want to comment out the associated line if you feel that removing the. vs folder from the root directory of your solution. Notice that this snippet also wipes out the. If you vote this answer be sure to vote them both as well.įor Visual Studio 2015 the MSBuild variables have changed a bit: He also provides a good suggestion on making the task easier to deploy and maintain if you have multiple projects to push this into. vs deletion as this would be better served in a. Edit again with parts from xDisruptor but I removed the. Slight evolution based on Shaman's answer below (share the votes and give him some too) Which will remove everything in your bin folder of the current platform/configuration. *proj by adding this somewhere near the end : You can circumvent this problem with a simple change to your. If you have some customizations in your MSBuild project this could spell trouble and leave behind stuff you would think it should have deleted. But it will leave behind everything else.

As others have responded already Clean will remove all artifacts that are generated by the build.
