VisualStudio2010调试 - 该过程无法访问该文件...因为它被另一个进程使用 [英] VisualStudio2010 Debugging - The process cannot access the file ... because it is being used by another process

查看:626
本文介绍了VisualStudio2010调试 - 该过程无法访问该文件...因为它被另一个进程使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用发布的Visual Studio 2010教程调试WinForms C#应用程序。

I'm unable to debug a WinForms C# application using the released version of Visual Studio 2010 Prof.

在第二次调试运行后,我收到以下错误消息。

I get the following error message after the second debugging run.

错误9无法将文件obj\x86\Debug\Arrowgrass Reports.exe复制到bin\Debug\Arrowgrass报告。可执行程序。该进程无法访问文件'bin\Debug\Arrowgrass Reports.exe',因为它被另一个进程使用。

我试过一个预构建脚本来尝试删除此文件,但它被Visual Studio锁定。

I've tried a pre-build script to attempt to delete this file, but it's locked by Visual Studio.

网上有一些引用,所以这是一个知道问题。有没有人有一个修补程序或有效的解决方案?

There are a few references to this on the net so it is a know problem. Does anyone have a hotfix or effective work-around?

推荐答案

我发现这个问题很容易复制,我是Richard Fors的答案的变化。如果我在设计器中打开了一个UserControl,运行调试器,然后编辑UserControl,后续的重建将失败。如果在运行调试器之前关闭了UserControl,我从来没有收到这个错误,所以我只需确保在点击F5之前关闭设计器窗口。

I have found this issue very easy to reproduce, and the fix for me is a variation on Richard Fors' answer. If I have a UserControl open in the designer, run the debugger, and then edit the UserControl, the subsequent rebuild will fail. If I close the UserControl before running the debugger I never get this error, so I just make sure to close the designer window before hitting F5.

这篇关于VisualStudio2010调试 - 该过程无法访问该文件...因为它被另一个进程使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆