{
  "WorkItem": {
    "AffectedComponent": {
      "Name": "",
      "DisplayName": ""
    },
    "ClosedComment": "",
    "ClosedDate": null,
    "CommentCount": 0,
    "Custom": null,
    "Description": "Consider the the following code:\n \nusing (var ms = new MemoryStream())\n{\n  this.WriteProjectConfig(this.ProjectConfig, ms); //provides some data in the memory stream\n  ms.Seek(0, SeekOrigin.Begin);\n  var entry = this.ZipFile[CONFIG_FILE_NAME];\n  if (entry != null)\n  {\n    this.ZipFile.RemoveEntry(entry);\n//!!    this.ZipFile.Save(pathAndFilename); //workaround, otherwise file content in zip might be zero bytes\n  }\n  this.ZipFile.AddEntry(CONFIG_FILE_NAME, ms);\n  this.ZipFile.Save(pathAndFilename);\n}\n \nThis code might become executed several times, without disposing/re-initializing the ZipFile object. The first time this runs (and the file is already in the zip, thus is being removed and re-added already on the first attempt), this works well. The second++ time this code in executed it runs without exeception, but the file in the zip is of 0 bytes length, though the memory stream contained something like 10000 bytes of data. But this data somehow gets lost. The workaround is to do a ZipFile.Save() after removing the entry and again after adding it. I use Ionic.Zip.Reduced Version 1.9.1.8 (the latest).",
    "LastUpdatedDate": "2013-02-21T18:42:54.313-08:00",
    "PlannedForRelease": "",
    "ReleaseVisibleToPublic": false,
    "Priority": {
      "Name": "Low",
      "Severity": 50,
      "Id": 1
    },
    "ProjectName": "DotNetZip",
    "ReportedDate": "2012-03-13T22:46:27.093-07:00",
    "Status": {
      "Name": "Proposed",
      "Id": 1
    },
    "ReasonClosed": {
      "Name": "Unassigned"
    },
    "Summary": "ZipEntry not saved when removing/re-adding it twice",
    "Type": {
      "Name": "Issue",
      "Id": 3
    },
    "VoteCount": 2,
    "Id": 14817
  },
  "FileAttachments": [],
  "Comments": []
}