title: Download File and Extract Immediately - File is being used by another process
body: <p>I'm looping through a list of zip files and downloading them from a WebClient.  I'm trying to extract them immediately after they download, but getting an error that the file is being used by another process.</p>
  
  <blockquote>
    <p>Error: The process cannot access the file 'c:\temp\test.zip' because it is being used by another process.</p>
  </blockquote>
  
  <p>The only thing that I can think of is that maybe the file is still "in use" for a short time after being downloaded?  DownloadFile does block ("This method blocks while downloading the resource." - <a href="http://msdn.microsoft.com/en-us/library/ez801hhe(v=vs.110).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ez801hhe(v=vs.110).aspx</a>), so I can't see it being an issue with the file still downloading.</p>
  
  <p>Any ideas on a workaround?</p>
  
  <pre><code>Using client As New WebClient
      oLog.Info("Downloading " &amp; strFileServer &amp; " to " &amp; strFileLocal &amp; "...")
      If Not Directory.Exists(strPathLocal) Then Directory.CreateDirectory(strPathLocal)
      client.DownloadFile(strFileServer, strFileLocal)
  End Using
  
  Using archive As ZipArchive = ZipFile.OpenRead(strFileLocal)
      For Each entry As ZipArchiveEntry In archive.Entries
          oLog.Info("Extracting " &amp; entry.FullName &amp; " to " &amp; strPathLocal &amp; "...")
          entry.ExtractToFile(strFileLocal, True)
      Next
  End Using
  </code></pre>