简体   繁体   English

清理C#Visual Studio 2010的bin obj文件夹

[英]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? 有没有办法清理所有依赖项和应用程序的bin /和obj /文件夹? 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. Visual Studio 2010中是否有一个选项,可以在生成解决方案之前清理这些文件夹。 The Clean Solution does not clean the copied dlls, but only cleans the application executables. 清理解决方案不会清理复制的dll,而只会清理应用程序的可执行文件。

import Get-Directory from: https://stackoverflow.com/a/3270377/89584 从以下位置导入Get-Directory: 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. 解决方案根目录在哪里SOLUTION_DIR在哪里。

You could probably turn this into a build event fairly easily. 您可能很容易将其转换为构建事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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