Error: the file is being used by another process
social.msdn.microsoft.com › Forums › en-USAug 31, 2018 · Hi All, Here is an application, there are three threads. And each thread contains a function as below to write the same file: Using(StreamWriter log = File.AppendText(filePathandName))) { } The first two threads are running normally, but the third thread will throw an exception occasionally at using (…). The exception message: The process cannot access the file ‘filePathandName’ because it is being used by another process.