Visual Studio - “复制”任务意外失败

Sco*_*Sto 0 visual-studio visual-studio-2013

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

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
Run Code Online (Sandbox Code Playgroud)

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

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

我的下一个操作是删除该项目并从源代码管理中再次获取它。

关于可能导致这种情况或将来防止这种情况的任何想法?

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

Sco*_*Sto 5

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

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