Question background:
I am attempting to overwrite the contents of one specified file with the contents of another specified file within a folder on my C drive using the following 'File.Replace' method:
//'null' has been set to the 'backup file' parameter as I do not need this.
File.Replace(fileOnesLocation, filesTwosLocation, null);
The error:
I have the above method wrapped in a try catch and am currently receiving the following error:
System.IO.IOException: The process cannot access the file
because it is being used by another process.
Can anyone point me in the right direction of whats going wrong here?