Visual Studio 2010 构建无法进行文件复制错误

发布于 2025-01-01 05:55:47 字数 415 浏览 0 评论 0原文

我正在 Visual Studio 2010 中构建一个项目,但构建失败,因为它无法将 assemblyname.dll 文件从 obj 复制到 bin 文件夹。确切的错误消息是:

错误 7 无法将文件“obj\Debug\AssemblyName.dll”复制到“bin\AssemblyName.dll”。无法在打开用户映射部分的文件上执行请求的操作。

我认为这是因为 bin 文件夹中的前一个文件无法访问。当我尝试手动删除文件时,出现错误“由于文件已在另一个程序中打开,因此操作无法完成”。如果我尝试查看哪个应用程序使用 Unlocker 锁定文件,我不会得到任何结果(未找到锁定句柄)。

如果我重新启动 Visual Studio,该错误就会消失,但在一两次构建后会再次发生。不用说,这严重减慢了我的速度。有什么建议如何开始解决这个问题吗?

I'm building a project in Visual Studio 2010 and the build fails because it cannot copy the assemblyname.dll file from obj to bin folder. The exact error message is:

Error 7
Unable to copy file "obj\Debug\AssemblyName.dll" to "bin\AssemblyName.dll". The requested operation cannot be performed on a file with a user-mapped section open.

I think this is because the previous file in bin-folder is not accessible. When I try to delete the file manually, I get an error "The action can't be completed because the file is open in another program". If I try to see what application locks the file with Unlocker, I don't get any results (No Locking handle found).

If I restart Visual Studio, the error goes away but happens again after a build or two. Goes without saying that this is seriously slowing me down. Any advice how to start solving this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

Windows 8 上的 VIsual Studio 2012。我在我的项目中收到相同的错误消息。重新启动 Visual Studio 或手动清理 obj 文件夹没有帮助。最后,我关闭了所有打开的文件(Windows -> 关闭所有文档),问题就消失了。

VIsual Studio 2012 on Windows 8. I was receiving the same error message on my project. Restarting Visual Studio or cleaning the obj folder manually did not help. Finally I closed all open files (Windows -> Close All Documents) and the problem went away.

决绝 2025-01-08 05:55:47

此行为是由于新安装的名为 Visual Studio Achievements 的 Visual Studio 扩展 (http://visualstudiogallery.msdn.microsoft.com/bc7a433b-b594-48d4-bba2-a2f24774d02f)

我注意到 .pdb 文件被 FxCop 锁定(使用 Unlocker),我认为成就扩展使用了它。禁用扩展后,我不再收到上述错误。

This behavior was due to a newly installed Visual Studio extension called Visual Studio Achievements (http://visualstudiogallery.msdn.microsoft.com/bc7a433b-b594-48d4-bba2-a2f24774d02f)

I noticed that the .pdb file was locked by FxCop (using Unlocker) and I think that the Achievements -extension uses it. After disabling the extension I've no longer got the error mentioned above.

丢了幸福的猪 2025-01-08 05:55:47

此错误已在最新版本的扩展(>1.7)中修复。它是作为测试版发布的,顺便说一句......

This bug has been fixed in recent versions of the extension (>1.7). It was released as a beta, btw...

挖鼻大婶 2025-01-08 05:55:47

即使在我的计算机上(以及我同事的计算机上),VS 的这种行为也经常发生。

根据我的经验,在以下情况下更频繁地发生:

  • 我在编译时在设计中打开了某种表单
  • 我通过按“停止”按钮停止应用程序的执行
    在VS中而不是退出应用程序

因此,在编译之前关闭设计中的表单,然后退出应用程序而不是停止它,在一定程度上缓解了这个问题......但它仍然会发生:-|

我的电脑是 Win 7 x64 SP1,带有 VS 2010 SP1,8Gb 内存,没有交换文件

This behavior of VS happen very often even on my computer (and on computers of my coworkers).

In my experience it happen more frequently when:

  • I have some form opened in design when i compile
  • I stop the execution od the application by pressing the "stop" button
    in VS instead of exiting the application

So, closing the form in design before compile, and exiting the application instead of stopping it, somewhat mitigate the issue... but it still happen :-|

My computer is Win 7 x64 SP1 with VS 2010 SP1, 8Gb ram, and no swap file

旧时模样 2025-01-08 05:55:47

平台:Windows 8 Pro、Visual Studio 2012

我发现在访问 Windows 资源管理器中的文件夹时收到此错误。

我正在使用 Visual Studio 2012 创建 PDF 文档。要查看示例文档,我将在解决方案资源管理器中右键单击并使用文件资源管理器中的“打开文件夹”。

在 Windows 7 上,如果实际的 PDF 文档是在 Adob​​e Reader 中打开的,我会收到 SYSTEM.IO 错误,这是预期的。在 Windows 8 中,我发现如果打开该文件夹,则会收到上述错误。我怀疑与 Windows 8 预览版有冲突。

如果我关闭文件夹并运行程序,它就可以正常工作。

Platform: Windows 8 Pro, Visual Studio 2012

I found that I receive this error when I am accessing the folder in Windows Explorer.

I was creating PDF documents with Visual Studio 2012. To review the sample document I would right click in Solution Explorer and use Open Folder in File Explorer.

On Windows 7 I would get a SYSTEM.IO error if the actual PDF document was open in Adobe Reader which is expected. With Windows 8 I found that I receive the above error if I have the folder open. I suspect there is a conflict with the Windows 8 preview.

If I close the folder and run the program it works fine.

尘曦 2025-01-08 05:55:47

检查是否在 Visual Studio 中打开了 dll。
我在 Visual Studio 中打开 dll 并发生此错误!

Check if you open the dll in visual studio.
I open the dll in visual studio and this error happen!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文