Visual Studio Build Woes

I’ve had some problems with Visual Studio getting confused about what has and has not been built, and I found a post recommending removing the bin and obj directories for all projects in the solution.

My first instinct was into git bash and a quick find

find . \(-name "bin" -or -name "obj"\) -exec rm -r {} \;

Then I wondered what the PowerShell equivalent of that would be

This page ( https://sachabarbs.wordpress.com/2014/10/24/powershell-to-clean-visual-studio-binobj-folders/ ) provided me with

gci -inc bin,obj -rec | rm -rec -force

But that’s a little dangerous removing files named bin and obj too so here is a safer version that only considers directories

Get-ChildItem -inc bin,obj -Directory -Recurse | Remove-Item -Recurse -Force
x Logo: Shield
This Site Is Protected By
Shield