The App is throwing the Exception "System.IO.IOException The process cannot access the file because it is being used by another process. Void WinIOError(Int32, System.String)" , when Moving a File from one folder to the other.
The code is below.
foreach (var item in fileList)
{
Log.Info("Moving " + item + " to the XXXXX folder.");
var target = Path.Combine(
config.FTPHistoryFolderLocation,
Path.GetFileNameWithoutExtension(item) + "_TYM" + DateTime.Now.ToString("MMddyyyy_HHmmssffff") + Path.GetExtension(item));
File.Move(item, target);
}
Please suggest if this could occur due to lack of space in the folder.