Directory.Move(src, dest) fails sometimes. Solution is to wrap the first attempt in a try/catch. If an exception is caught, call Thread.Sleep(few seconds) and then retry without a try/catch. This gives the underlying build task sufficient time to wind down and release any locks it might have on the file system before attempting to move.
Directory.Move(src, dest)
fails sometimes. Solution is to wrap the first attempt in a try/catch. If an exception is caught, callThread.Sleep(few seconds)
and then retry without a try/catch. This gives the underlying build task sufficient time to wind down and release any locks it might have on the file system before attempting to move.