I have some code and when it executes, it throws a IOException
, saying that
The process cannot access the file \'filename\' because it
I'm using FileStream and having same issue.. When ever Two request try to read same file it throw this exception.
solution use FileShare
using FileStream fs = System.IO.File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
I'm Just Reading a file concurrently FileShare.Read
solve my issue.