I have some code and when it executes, it throws a IOException, saying that
IOException
The process cannot access the file \'filename\' because it
I had this problem and it was solved by following the code below
var _path=MyFile.FileName; using (var stream = new FileStream (_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { // Your Code! ; }