ExtractAll throws System.IO.IOException and ignored ExtractExistingFileAction

Aug 29, 2012 at 10:21 PM


When I extract the files in a zip archive to a destination directory where some of those files may already exist I get this error.

[CLASSNAME] threw exception:
System.IO.IOException: The file [FILENAME] already exists.

The component that is responsible for zipping/unzipping files is separated into 2 files.

Zip and ZipHelper

public class Zip
   string zipPath = "aPath";
   public bool Decompress(string destinationPath)

           ZipHelper helper = new ZipHelper(zipPath);
           using (_zipDm.Open())

public class ZipHelper
  string Path{get;set;}
  ZipFile _zip;
  public ZipHelper(string path)
    this.Path = path;
 public void ExtractAll(string destinationPath)
_zip.ExtractAll(destinationPath,ExtractExistingFileAction.OverwriteSilently); } public IDisposable Open() { _zip = new ZipFile(this.Path); return _zip; } }

Documentation says
"This property has no effect when extracting to a stream, or when the file to be extracted does not already exist."

But I am not passing a stream I am passing a string to the extract all method.

I have also tried using the Read() method and using a forloop to call the Extract method for each individual Entry.

Please Help me.