title: "The process cannot access the file because it is being used by another process" with Images
body: <p>I've seen many issues like this that have been solved and the problem was mostly due to streams not being disposed of properly.</p>
  
  <p>My issue is slightly different, here follow a code snippet</p>
  
  <pre><code> foreach (Images item in ListOfImages)
   {
        newPath = Path.Combine(newPath, item.ImageName + item.ImageExtension);
        File.Create(newPath);
  
        File.WriteAllBytes(newPath, item.File);
   }
  </code></pre>
  
  <p>Where <code>Images</code> is a custom struct and <code>item.File</code> is the raw data, byte[].</p>
  
  <p>My issue is that at the line where the <code>WriteAllBytes</code> is called, an exception is thrown. The message reads:</p>
  
  <p><code>The process cannot access the file because it is being used by another process</code></p>
  
  <p>Again I have no clue how am I going to somehow <code>close</code> the process.</p>