I am using File.Copy(source, dest, true) to copy a file from local to remote with overwrite option. In my case, the dest is a mapped network drive:
File.Copy(source, dest, true);
UnMapDrive(); // unmap the network drive
The problem I have afterward is that the source file may be locked so that I could not delete the file from local.
I guess that it might be caused by File.Copy() call. Not sure if this one is synced process or not. In other words, is the source file released after the call?