Subject: ATP DLL 6.1.40.50120 - The given key was not present in the dictionary
Date: 2015-02-12 07:38:09
From: Iris Maag
Source: atp-dll-6-1-40-50120-given-key-not-present-dictionary
----------------------------------------------------------------------

Hallo,

if there is already a file in the zip, and i try to update it, i received the error "The given key was not present in the dictionary." from function "EndUpdate()" (ComponentPro.Zip.dll    6.1.40.50120 )

with the old version ComponentPro.Zip.dll    6.0.40.40629    this code works fine.

[code lang='c#']

Zip zip = new Zip();
            
            try
            {
                if (action.Equals("append"))
                {
                    //checkzip
                    checkZip(targetFileName);

                    zip.Open(targetFileName);
                }
                else
                {
                    zip.Create(targetFileName);
                }

                zip.BeginUpdate();

                foreach (KeyValuePair<String, String> entry in dictFilesToZip)
                {
                    string strTargetFile = entry.Value;

                    if (zip.FileExists(strTargetFile))
                        zip.DeleteFile(strTargetFile);

                    zip.AddFile(entry.Key, strTargetFile);
                }
                zip.EndUpdate();
            }
            catch (Exception ex)
            {
                zip.CancelUpdate();
                throw ex;
            }
            finally
            {
                zip.Close();
            }

[/code]

Thanks for help.

---------------------------------------------------------------------- Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor who sold you the license and ask for your money back. Back to ComponentPro Q&A Forum Index