title: Process cannot access the file "MyFile.log" because it is being used by another process
body: <p>I am getting</p>
  
  <blockquote>
    <p>The process cannot access the file "MyFile.log" because it is being used by another process.</p>
  </blockquote>
  
  <p>while I am doing this</p>
  
  <pre><code>File.SetAttributes(filename,FileAttributes.Normal)
  
  using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite))
  {
      // Do stuff with log4net log
  }
  </code></pre>
  
  <p>I have read other posts but they all suggest what I am already doing. Any other suggestions?</p>
  
  <p>Thanks.</p>