Under the remarks section for System.IO.File.Replace in the MSDN documentation there is mention that an exception will be thrown if the volume(drive) is different between the source and destination paths.
If the sourceFileName and destinationFileName are on different volumes, this method will raise an exception.
There is no mention in the exception section what type of System.IO.IOException you will receive in this case.
I found that when the volume for the destination and the source files differ you will receive:
System.IO.IOException: Unable to move the replacement file to the file to be replaced. The file to be replaced has retained its original name.
System.IO.FileInfo.Replace will also throw the above exception when the destination volume differs from the source file’s volume. However the Documentation for System.IO.FileInfo.Replace makes no mention of this error condition.
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.