6
Answers

ICsharpCode ERROR (unzipping file)

thiago costa

thiago costa

13y
21k
1
Hello there guys...
This code was working fine... I made zero modifications to the software.

I formated the computer today, reinstalled Visual Studio 2010, and tried to compile it Now it gives me an error...

This is the code:

 ICSharpCode.SharpZipLib.Zip.FastZip shpZip = new ICSharpCode.SharpZipLib.Zip.FastZip();

            shpZip.ExtractZip("update.zip", Application.StartupPath, ".*");
            System.Diagnostics.Process.Start("generator.exe");

It was working 100% fine, untill I reinstalled it... Some other friend told me he had a problem too a month ago, but i thoght it was somethign wrong with his machine, but now I realize 
the error really exists (I dont know why It was working before).

This is the error:

Cannot find central directory

It points the error at this line:

shpZip.ExtractZip("update.zip", Application.StartupPath, ".*");
Thanks guys...

Why did it work before and now it doesn't ? I don't understand... Thats the error inside the compiler..
This is the error outside of the compiter when I run the program:


 See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
ICSharpCode.SharpZipLib.Zip.ZipException: Cannot find central directory
   at ICSharpCode.SharpZipLib.Zip.ZipFile.ReadEntries()
   at ICSharpCode.SharpZipLib.Zip.ZipFile..ctor(String name)
   at ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip(String zipFileName, String targetDirectory, Overwrite overwrite, ConfirmOverwriteDelegate confirmDelegate, String fileFilter, String directoryFilter, Boolean restoreDateTime)
   at ICSharpCode.SharpZipLib.Zip.FastZip.ExtractZip(String zipFileName, String targetDirectory, String fileFilter)
   at SelfUpdate.Form1.Completed(Object sender, AsyncCompletedEventArgs e)
   at System.Net.WebClient.OnDownloadFileCompleted(AsyncCompletedEventArgs e)
   at System.Net.WebClient.DownloadFileOperationCompleted(Object arg)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
SelfUpdate
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Ultra/Desktop/c-sharp_Generator/1_SelfUpdate.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------


Thanks alot guys
Answers (6)