title: ZipFile Library Extraction issue in C# .net 4.5
body: <p>I was trying to create a console app for zip file extraction &amp; compression using C# on .net 4.5.
  I have Visual Studio 2012.</p>
  
  <p>Problem:</p>
  
  <p>My code snippet:</p>
  
  <pre><code>static void Main(string[] args)
  {
      string fromPath = @"E:\Development Helpers\Folder Browser";
      string toPath = fromPath + @"\TempFolder";
      CombineFile.CombineFile combineFile = new CombineFile.CombineFile();
  
      String[] files = Directory.GetFiles(fromPath);
        foreach (string file in files)
          {
            try
              {             
                      string fileName = Path.GetFileName(file);
                      String ext = Path.GetExtension(file);
                      String filePath = Path.GetFullPath(file);
                      Console.WriteLine(" File Name: " + fileName + " tempPath= " + ext);                            
                      Console.ReadKey(true);
                      ZipFile.ExtractToDirectory(fromPath, toPath);
  
                      Console.WriteLine(" File Name: " + fileName + " tempPath= " + ext + " Path: " + filePath);
              }
                    catch (Exception ex)
              {
                  Console.WriteLine(" Exception = " + ex.StackTrace);
              }
  
      }
      Console.ReadKey(true);
  }
  </code></pre>
  
  <p>In place of:         </p>
  
  <pre><code>ZipFile.ExtractToDirectory(fromPath, toPath);
  </code></pre>
  
  <p>I tried <code>ZipArchive</code> too but got same Error</p>
  
  <pre><code>ZipArchive archive = ZipFile.Open(file, ZipArchiveMode.Update);
  archive.CreateEntry("A.csv");
  archive.ExtractToDirectory(toPath);
  </code></pre>
  
  <p>Even I tried SevenZipExtractor Api from <a href="http://sevenzipsharp.codeplex.com/releases/view/51254" rel="nofollow">CodeFlex</a></p>
  
  <p>Did following code:</p>
  
  <pre><code>SevenZipExtractor extractor = new SevenZipExtractor(file);
  extractor.ExtractArchive(toPath);
  </code></pre>
  
  <p>But got same exception each time, I am not getting what to do, I searched every where but not found proper solution. Please help me to get out of this problem, I have to deliver this small thing till next day.</p>
  
  <blockquote>
    <p>Exception Facing:<br>
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)<br>
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)<br>
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)<br>
    at System.IO.File.Open(String path, FileMode mode, FileAccess access, FileShare share)<br>
    at System.IO.Compression.ZipFile.Open(String archiveFileName, ZipArchiveMode  mode, Encoding entryNameEncoding)<br>
    at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, Encoding entryNameEncoding)<br>
    at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName)<br>
    at CombineFileConsole.Program.Main(String[] args) in e:\Projects\WorkSpace_DotNet\TestingProjects\CombineFileConsoleTest\Program.cs:line 36 File Name: Test_7Zip_300.zip tempPath= .zip</p>
  </blockquote>