title: Read file that's already used by another process
body: <p>I have a C# app that tries to read a log file which is being written to by another app. When I try to read the file, I get IOException </p>
  
  <blockquote>
    <p>"The process cannot access the file ... because it is being used by
    another process."</p>
  </blockquote>
  
  <p>What I tried using so far are the following, but none of them fix the problem</p>
  
  <pre><code>var log = File.ReadAllText(logPath);
  
  var stream = new FileStream(logPath, FileMode.Open);
  
  using (var stream = File.Open(logPath, FileMode.Open))
    {
  
    }
  </code></pre>