I\'m trying to read a file body from a Windows shared folder by it\'s UNC path, and getting this exception: The process cannot access the file \'\\\\
Try changing FileShare.Delete to FileShare.ReadWrite. This will allow the file to be read and written by other applications simultaneously. In other words
var logFile = (string)null;
using (var fileStream = new FileStream(logPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
using (var reader = new StreamReader(fileStream))
{
logFile = reader.ReadToEnd();
}
}