c# - Visual Studio "Could not copy".... 在构建期间

我在构建 VS2012 C# 项目期间不断收到此错误

Error   41  Could not copy "obj\Debug\WeinGartner.WeinCad.exe" to
 "bin\Debug\WeinGartner.WeinCad.exe". 
 Exceeded retry count of 10. Failed.    


Error   42  Unable to copy file "obj\Debug\WeinGartner.WeinCad.exe" to
"bin\Debug\WeinGartner.WeinCad.exe". The process cannot access the file
'bin\Debug\WeinGartner.WeinCad.exe' because it is being used by another 
process.    

现在我发现杀死进程

Weingartner.WeinCad.vhost.exe

有效(有时),但这让我很紧张。有什么办法可以完全阻止这种情况的发生?

我的调试器设置是

最佳答案

我在 Visual Studio 2013 中遇到过类似的错误消息。

大多数情况下,我发现这种情况发生在调试过程因异常而停止时。

当 clean+build 没有为我解决这个问题时,我通过执行以下操作取得了成功:

  • 关闭 Visual Studio
  • 删除 binobj 文件夹,以及
  • 重新打开 Visual Studio。

这个“错误”自 Visual Studio 2003 以来就存在。

最后,我还发现我通常可以通过简单地重命名可执行文件然后删除它来解决这个问题。

关于c# - Visual Studio "Could not copy".... 在构建期间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18102859/

相关文章:

objective-c - iOS - 构建失败,CocoaPods 找不到头文件

java - NoClassDefFoundError - Eclipse 和 Android

c# - 外部VS2013构建错误 "error MSB4019: The imported pro

ios - 警告 : The Copy Bundle Resources build phase c

java - Maven : add a dependency to a jar by relati

android - 使用 Android Studio 构建未签名的 APK 文件

visual-studio - Visual Studio 中 Rebuild 和 Clean +

macos - 在 Mac OS X 上安装/升级 gradle

visual-studio - obj 和 bin 文件夹(由 Visual Studio 创建)用

javascript - 让 Grunt 为不同的设置生成 index.html