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
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:
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?
EDIT: I was able to manually copy the files into another directory and rebuild that way, excluding the "bin" and "obj" folders.