File is used by another process: How to solve this Error?
<p>I am trying to open a file, but I received:</p>

<p>The process cannot access the file because it is being used by another process. The File is an XML-Document. Can anyone help?</p>

<pre><code>  string activeDirectory = @"X:\SubGraph\";
  string[] files = Directory.GetFiles(activeDirectory);
  foreach (string fileName in files){
  FileStream file = new FileStream(fileName, FileMode.Open, FileAccess.Read);
</code></pre>
