Remove bin and obj folders in VS solution - FalconFT/FalconDocs GitHub Wiki
When the Visual Studio compiler (or publisher) cannot compile due bad references to other projects or deprecated packages, this script can easily help you to remove the bin and obj files, a sort of clean the solution before compile all again.
This PowerShell script must be executed into the solution base folder, and will remove -recursively- all bin and obj folders.
Write-Host "Deleting all bin and obj folders..."
Get-ChildItem -Path . -Recurse -Directory -Force |
Where-Object { $_.Name -in @("bin", "obj") } |
ForEach-Object {
Write-Host "Removing $($_.FullName)"
Remove-Item -Recurse -Force $_.FullName
}
Write-Host "Done."
Handle with care