Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

System.IO.IOException The process cannot access the file because it is being used by another process. Void WinIOError(Int32, System.String)

$
0
0

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.


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>