Visual Studio - “副本"任务意外失败 [英] Visual Studio - The "Copy" task failed unexpectedly

查看:45
本文介绍了Visual Studio - “副本"任务意外失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Visual Studio 2013,我在构建解决方案时突然开始收到此错误:

Using Visual Studio 2013, I have suddenly started getting this error when I build the solution:

The "Copy" task failed unexpectedly.
System.Runtime.InteropServices.COMException (0x800710FE): This file is currently not available for use on this computer. (Exception from HRESULT: 0x800710FE)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at Microsoft.Build.Shared.NativeMethodsShared.ThrowExceptionForErrorCode(Int32 errorCode)
   at Microsoft.Build.Tasks.FileState.EnsurePopulated()
   at Microsoft.Build.Tasks.FileState.get_FileExists()
   at Microsoft.Build.Tasks.Copy.IsMatchingSizeAndTimeStamp(FileState sourceFile, FileState destinationFile)
   at Microsoft.Build.Tasks.Copy.DoCopyIfNecessary(FileState sourceFileState, FileState destinationFileState, CopyFileWithState copyFile)
   at Microsoft.Build.Tasks.Copy.Execute(CopyFileWithState copyFile)
   at Microsoft.Build.Tasks.Copy.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() ScottProj

关于构建任务或项目/解决方案配置,我没有更改任何应该导致这种情况的内容.我正在更改代码,然后出现了.我回滚了我在此之前所做的特定更改,但这并没有解决它.没有自定义构建事件,只有一个简单的 Build -> Build Solution.我已经尝试过这些东西:

I have not changed anything regarding build tasks or project / solution configuration that should cause this. I was making code changes, and then this appeared. I rolled back the particular changes that I made before this occurred, but that did not resolve it. There are no custom build events, just a simple Build -> Build Solution. I have tried these things:

清理并重建解决方案.创建了另一个构建配置.已关闭 VS 2013.重新启动.删除了 obj 文件夹.

Cleaned and rebuilt the solution. Created another build configuration. Closed VS 2013. Rebooted. Deleted the obj folder.

我的下一步操作是删除该项目并从源代码管理中重新获取它.

My next action is to delete the project and get it again from source control.

有什么想法可能导致这种情况或将来会阻止这种情况发生吗?

Any ideas to what may have caused this or prevent it in the future?

我能够手动将文件复制到另一个目录并以这种方式重建,不包括bin"和obj"文件夹.

I was able to manually copy the files into another directory and rebuild that way, excluding the "bin" and "obj" folders.

推荐答案

问题是,在我们的环境中,我一直在存储 VS 项目的我的文档"文件夹自动同步到网络共享.但有时,会出现同步问题,DLL 会永远被锁定.(我几个月前发布的这个问题的 DLL 仍然被锁定.)

The problem was that, in our environment, the "My Documents" folder, where I had been storing the VS project, was auto-synced to a network share. But sometimes, a syncing problem would occur and the DLLs would become locked forever. (The DLLs from this issue, which I posted a few months ago, are still locked.)

我的解决方案是将解决方案移动到未同步到网络共享的文件夹中.这些文件保存在源代码管理中,所以我不需要备份它们.

My solution was to move the solution to a folder that was not synced to a network share. These files are kept in source control, so I didn't need them to be backed up.

这篇关于Visual Studio - “副本"任务意外失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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