I have similar issue. But I am using a windows service to read file from a specific directory. It is possible multiple files come at same time or one by one. problem is when I put a file it reads but when I put another file it throws file access exception. Please Help. Thanks.
Here is the code:
private static void OnCreated(object source, FileSystemEventArgs e)
{
try
{
var data = new FileData();
data.ReadFile(e.FullPath);
}
catch (Exception ex)
{
WriteLogForError(ex.Message, String.Empty, ErrorLogPath);
}
}