I'm getting to load my file from disk but I'm getting an error: System.IO.IOException.
FileStream attachment;
using (var stream = File.Open(@"c:\testFolder\test.txt", FileMode.Open))
{
attachment = stream;
}
Error from logs:
Exception thrown: 'System.IO.IOException' in System.IO.FileSystem.dll Exception thrown: 'System.IO.IOException' in System.Private.CoreLib.ni.dll 2017-04-20 07:19:08 [Error] Invalid argument
The file exists.
What I'm doing wrong?
I'm using Asp.Net Core 1.1.