[
  {
    "Id": "451454",
    "ThreadId": "214916",
    "Html": "<p>I have been trying to get this to work for some time now. I just upgraded to the newest version 1.9.5.2 to try&nbsp;to fix my error, but it is still not working. I am using Visual Basic in Visual Studio 2010.</p>\r\n<p>What I'm doing is updating a file in&nbsp;a large zip archive. Then I am extracting the whole archive and doing a few other things. I use this code to update the file within the archive.</p>\r\n<p>&nbsp;<span style=\"color:blue\">Try</span><br>&nbsp;&nbsp;&nbsp; <span style=\"color:blue\">Dim</span> output = (directory.ToString() &amp; <span style=\"color:#a31515\">&quot;\\HeroPak_client.zip&quot;</span>)<br>&nbsp;&nbsp;&nbsp; <span style=\"color:blue\">Using</span> zip <span style=\"color:blue\">As</span> ZipFile = ZipFile.Read(output)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zip.UpdateFile(<span style=\"color:blue\">My</span>.Computer.FileSystem.CurrentDirectory &amp; <span style=\"color:#a31515\">&quot;\\&quot;</span> &amp; character_names_list.Text.ToString() &amp; <span style=\"color:#a31515\">&quot;.inibin&quot;</span>, <span style=\"color:#a31515\">&quot;\\DATA\\Characters\\&quot;</span> &amp; character_names_list.Text.ToString() &amp; <span style=\"color:#a31515\">&quot;\\&quot;</span>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zip.Save()<br>&nbsp;&nbsp;&nbsp; <span style=\"color:blue\">End</span> <span style=\"color:blue\">Using</span><br><span style=\"color:blue\">Catch</span> ex <span style=\"color:blue\">As</span> Exception<br>&nbsp;&nbsp;&nbsp; MessageBox.Show(ex.ToString)<br><span style=\"color:blue\">End</span> <span style=\"color:blue\">Try</span></p>\r\n<p>Then I run this code after that has finished.</p>\r\n<div style=\"color:black;background-color:white\">\r\n<pre><span style=\"color:blue\">Try</span>\r\n    <span style=\"color:blue\">Dim</span> ZipToUnpack <span style=\"color:blue\">As</span> <span style=\"color:blue\">String</span> = (directory &amp; <span style=\"color:#a31515\">&quot;\\HeroPak_client.zip&quot;</span>)\r\n    <span style=\"color:blue\">Dim</span> UnpackDirectory <span style=\"color:blue\">As</span> <span style=\"color:blue\">String</span> = (<span style=\"color:blue\">My</span>.Computer.FileSystem.SpecialDirectories.Desktop &amp; <span style=\"color:#a31515\">&quot;\\test\\&quot;</span>)\r\n    <span style=\"color:blue\">Using</span> zip1 <span style=\"color:blue\">As</span> ZipFile = ZipFile.Read(ZipToUnpack)\r\n        zip1.ExtractAll(<span style=\"color:blue\">My</span>.Computer.FileSystem.SpecialDirectories.Desktop &amp; <span style=\"color:#a31515\">&quot;\\test&quot;</span>)\r\n    <span style=\"color:blue\">End</span> <span style=\"color:blue\">Using</span>\r\n<span style=\"color:blue\">Catch</span> ex <span style=\"color:blue\">As</span> Exception\r\n    MessageBox.Show(ex.ToString)\r\n<span style=\"color:blue\">End</span> <span style=\"color:blue\">Try</span>\r\n</pre>\r\n</div>\r\n<p>While trying to do the extracting (second&nbsp;code)&nbsp;I get an error at the line that starts with Using zip1 As ZipFile = ZipFile.Read(ZipToUnpack). This is the error.</p>\r\n<p>System.ArgumentException: An item with the same key has already been added.<br>&nbsp;&nbsp; at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)<br>&nbsp;&nbsp; at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)<br>&nbsp;&nbsp; at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)<br>&nbsp;&nbsp; at Ionic.Zip.ZipFile.ReadCentralDirectory(ZipFile zf)<br>&nbsp;&nbsp; at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf)<br>&nbsp;&nbsp; at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding, EventHandler`1 readProgress)<br>&nbsp;&nbsp; at Ionic.Zip.ZipFile.Read(String fileName)<br>&nbsp;&nbsp; at LoL_Item_Changer.main.Button1_Click(Object sender, EventArgs e) in C:\\Users\\USER\\Documents\\Visual Studio 2010\\Projects\\PROGRAM\\PROGRAM\\main.vb:line 459&nbsp;</p>\r\n<p>Am I doing something wrong with updating the file, or is there some kind of bug here. Any help is appreciated. Thanks in advance!</p>",
    "PostedDate": "2010-06-03T15:30:13.36-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "451464",
    "ThreadId": "214916",
    "Html": "<p>it sure seems like a bug to me.&nbsp;</p>\r\n<p>can you provide a test case that reproduces the problem repeatedly?&nbsp;&nbsp;If so, &nbsp;I'll be able to fix it quickly.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-06-03T15:54:28.053-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "451470",
    "ThreadId": "214916",
    "Html": "<p>I just wrote a quick test program and I am having the same issues. Here is a link to the test app i made. If you go to the debug folder and run the test app.exe it should give the error.</p>\r\n<p>First update the zip file then extract the contents. An error is given.</p>\r\n<p>Here is the link to the zip download with the application and source code in it.</p>\r\n<p><a href=\"http://dsanders.homeserver.com/downloads/Test App.zip\"></a></p>",
    "PostedDate": "2010-06-03T16:20:02.163-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "451542",
    "ThreadId": "214916",
    "Html": "<p>Ah, I don't want your app.</p>\r\n<p>I just want 20 lines of code that will reproduce the problem.&nbsp; If it's as simple as you say, then you should be able to give me the code that causes it, right?</p>\r\n<p>A simple console application.&nbsp; Or just one method, if you like, that does whatever it needs to do, to cause the problem.</p>\r\n<p>&nbsp;</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-06-03T22:17:48.617-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "451546",
    "ThreadId": "214916",
    "Html": "<p>I've been testing it out some more and found that the problem seems to lie in my zip file. My code works with other files fine. Any suggestions on how to fix the zip file, or how to see whats wrong with it?</p>",
    "PostedDate": "2010-06-03T22:29:17.777-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "451606",
    "ThreadId": "214916",
    "Html": "<p>well you could try the ZIpInputStream - it does not build a list of entries, so you might avoid the problem entirely.&nbsp; &nbsp;you could unzip/extract each file in turn then examine the contents.</p>\r\n<p>There is&nbsp;a checkzip method on the ZipFile - see the documentation for info.&nbsp; It may help.</p>\r\n<p>There is a -t (tesT) and -r (repair) option on the command-line unzip.exe tool that ships with DotNetZip. Those may help.</p>\r\n<p>good luck.</p>\r\n<p>&nbsp;</p>",
    "PostedDate": "2010-06-04T01:05:08.807-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "451622",
    "ThreadId": "214916",
    "Html": "<p>Thanks, I will try those out. Thanks for the help. Great work on it too. :)</p>",
    "PostedDate": "2010-06-04T01:31:25.9-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]