Need help with Ionic.Zip

Oct 1, 2014 at 6:48 PM
Edited Oct 1, 2014 at 7:31 PM
I just started to use this to create zip files which user can download.
My problem is after click the "download" button, nothing happens. I set break point and checked, seems the zip file has the files added, but somehow nothing happens. I tried in firefox and ie, neither one works.
I then added a try catch block and got this error message:
Message = Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.
The Error occurs after Response.End(); so I have no clue what caused it.
please see my code below:

ZipFile zip = new ZipFile();
        for (int i = 0; i < lbxlist.Items.Count; i++)
            if (lbxlist.Items[i].Selected)
                List<string> paths = getScannedFormPath(lbxlist.Items[i].Value, Convert.ToInt32(cbyear.SelectedValue));
                for (int j = 0; j < paths.Count; j++)
                    string s = paths[j].ToString();

                    if (!zip.ContainsEntry(paths[j].ToString()))


        Response.AddHeader("Content-Disposition", "attachment;");
        Response.ContentType = "application/zip";
Oct 1, 2014 at 7:33 PM
I changed the Response.End() to Response.Close(); and now I do not get the error message. But the zip file is still not showing up or being downloaded. Any ideas?