{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "I'm using VB.net 2008 with DotNetZip-v1.9.\n \nI'm extracting files that only contain one entry. When they are extracted a sub directory in created and they are placed in it.\n \nI do not want a sub directory created but for the file to be extracted directly to the root folder containing the zip.\n \nHere is what I tried and errors that I received:\n \n1)\n \nTheFile is a System.IO.FileInfo\n \nUsing ThisZIP As ZipFile = ZipFile.Read(TheFile.FullName)\n \nFor Each ThisEntry As ZipEntry In ThisZIP.Entries\n \nThisEntry.FileName = System.IO.Path.GetFileName(ThisEntry.FileName)\n \nThisEntry.Extract(\"E:\\DataTemp\\\", ExtractExistingFileAction.DoNotOverwrite) \n \nNext\n \n End Using\n \nThe file is extracted properly in the correct directory but I then get an exception thrown:\n \n\"Collection was modified; enumeration operation may not execute.\"\n \n2)Since there is only one entry in my zips I would prefer to just use ExtractAll, but I can not get it to extract to the root folder of the zip.\n \nDim ExtractedFullName As String = TheFile.FullName.Remove(TheFile.FullName.Length - 4) & \".xml\"\n \nUsing ThisZIP As New ZipFile(TheFile.FullName)\n \nThisZIP.ExtractAll(ExtractedFullName)\n \nEnd Using\n \n3) This was an example I found on a discussion but the ExtractAll() gives a error if I don't add a parameter to it.Using zip As ZipFile.Read(FilePath)\n \nzip.StatusMessageTextWriter= System.Console.Out\n \n'Status Messages will be sent to the console during extraction\n \nzip.ExtractAll()\n \nEnd Using4)This is what I'm using now. It works but I don't like it.\n \nUsing ThisZIP As ZipFile = ZipFile.Read(TheFile.FullName)\n \nThisZIP.Entries(0).FileName = System.IO.Path.GetFileName(ThisZIP.Entries(0).FileName)\n \nThisZIP.Entries(0).Extract(\"E:\\DataTemp\\\", ExtractExistingFileAction.DoNotOverwrite)\n \nEnd Using\n \nIf you have any suggestions, I appreciate it. I have spent some time searching thru the other discussions but have not found the answer I thought I needed.\n \nThanks,",
    "LastUpdatedDate": "2013-02-21T18:43:34.157-08:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2010-04-21T09:16:41.933-07:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "Verify that Flatten approach works in unzip.cs",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 1,
    "Id": 10683
  },
  "FileAttachments": [],
  "Comments": []
}