简体   繁体   中英

clean up bin obj folders for C# visual studio 2010

Is there a way to clean up the bin/ and obj/ folders of all dependencies and application? I am working on changing some of the references, and I have to manually clean up this from the drive for each dependency. It is a painful process. Is there an option in Visual Studio 2010 that will clean up these folders before I build solution. The Clean Solution does not clean the copied dlls, but only cleans the application executables.

import Get-Directory from: https://stackoverflow.com/a/3270377/89584

Function Get-Directory([string[]]$path, [string[]]$include, [switch]$recurse) 
{ 
    Get-ChildItem -Path $path -Include $include -Recurse:$recurse | `
         Where-Object { $_.PSIsContainer } 
} 

then do:

Get-Directory -Path SOLUTION_DIR -Include obj,bin -Recurse \
| Remove-Item -Force -Recurse 

where SOLUTION_DIR is wherever your solution root is.

You could probably turn this into a build event fairly easily.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM