使用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
我关于构建任务或项目/解决方案配置应该引起这个没有改变任何东西。我在修改代码,然后将此出现。我回滚,我提出在此之前发生的具体变化,但是这并没有解决这个问题。有没有自定义生成的事件,只是一个简单的生成 - >生成解决方案。我尝试了这些东西:
清洗和重建溶液。创造了另一个构建配置。封闭VS 2013年重新启动。删除obj的文件夹。
我的下一个动作是要删除的项目,并从源头控制再次得到它。
什么任何想法可能导致此或防止它的未来?
编辑:我可以手动将文件复制到另一个目录和重建的方式,排除的“bin”和“目标文件”文件夹。
问题是,在我们的环境中,“我的文档”文件夹中,我一直在存储VS项目,被自动同步到网络共享。但有时候,会出现同步的问题,这些DLL将成为永远被锁定。 (从这个问题,我发布了几个月前的DLL文件,仍被锁定)。
我的解决方案是移动解决方案,这是不同步到网络共享的文件夹。这些文件被保存在源代码控制,所以我并不需要它们来进行备份。
TFS或源代码控制是防止构建从编辑Resource.Designer.cs文件。检查Resource.Designer.cs出来的编辑,你应该是不错的。
我发现在Visual Studio 2017年这个问题。
只需删除从Windows资源管理器的Resource.Designer.cs文件的属性对话框中的只读复选标记。