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

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

问题描述

我无法使用已发布的 Visual Studio 2010 Prof. 版本调试 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 无法将文件objx86DebugArrowgrass Reports.exe"复制到binDebugArrowgrass Reports.exe".该进程无法访问文件binDebugArrowgrass 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天全站免登陆