[
  {
    "Id": "893918",
    "ThreadId": "389793",
    "Html": "\r\n<p>I'm creating a zip file using DotNetZip in another application, then manipulating it in another application. &nbsp;When I zip.Save(), DotNetZip creates a temp file but fails to delete it on zip.Dispose() (or when the using block finishes).</p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre>  <span style=\"color:blue\">using</span> (<span style=\"color:blue\">var</span> zip = ZipFile.Read(<span style=\"color:blue\">this</span>.Properties.GetZipPath()))\n  {\n       zip.CompressionLevel = Ionic.Zlib.CompressionLevel.None;\n             \n       zip.AddEntry(manifestFilename, Options.SerializeHelper.SerializeToXmlString(<span style=\"color:blue\">this</span>.manifestContents), System.Text.Encoding.UTF8);\n       <span style=\"color:blue\">if</span> (zip.ContainsEntry(extraContentFolder))\n       {\n           zip.AddFiles(<span style=\"color:blue\">this</span>.getExtraContentFiles(), extraContentFolder);\n       }\n        zip.Save();  // creates temp zip file and saves off changes to original zip\n    } // implicit zip.Dispose() - but temp file is not deleted!\n</pre>\r\n</div>\r\n<p>This is a representative sample of the block of code that's creating the temp file. &nbsp;I've tried commenting various lines inside the using {} statement, but DotNetZip consistently leaves the temp file behind if I make&nbsp;<em>any</em>&nbsp;changes to\r\n it.</p>\r\n<p>As I mentioned, the source zip file is created using DotNetZip in another application:</p>\r\n<div style=\"color:black; background-color:white\">\r\n<pre><span style=\"color:blue\">using</span> (ZipFile zip = <span style=\"color:blue\">new</span> ZipFile())\n{\n    zip.AddDirectory(directory.FullName);\n    zip.Save(zipFile);\n}\n</pre>\r\n</div>\r\n<p>&nbsp;</p>\r\n<p>What's strange is that, if you rebuild the source zip using 7-zip, then the temp files do not appear. &nbsp;Additionally, I'm doing similar processes (open zip, add files, save zip, dispose) elsewhere in various applications and I'm not seeing this temp\r\n file sticking around (I think).</p>\r\n<p>Am I missing some piece of magic here or when I create the source zip files?</p>\r\n",
    "PostedDate": "2012-07-31T15:01:52.877-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1217972",
    "ThreadId": "389793",
    "Html": "I have the same issue.  Did you ever find a solution? I see the project has not been updated. I may have to root around in the code to see if I can find &amp; fix it.\r<br />\nI've tried two variations with the same result:<br />\n<pre><code>using (ZipFile zip = new ZipFile())\n{\n    zip.AddEntry(fileName, content);\n    zip.Save(zipFileName);\n}</code></pre>\n\nand<br />\n<pre><code>using (ZipFile zip = new ZipFile(zipFileName))\n{\n    zip.AddEntry(fileName, content);\n    zip.Save();\n}</code></pre>\n\n",
    "PostedDate": "2014-03-03T06:51:03.893-08:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]