Compressing event never fired

Jun 7, 2012 at 8:35 AM
Edited Jun 7, 2012 at 8:37 AM


i'm using sevenzipsharp for the first time and i'm having issue with the compressing event, not being fired when i call beginCompressDirectory. I already searched on Google, and on the discussion board but i didn't found anything that fix this issue.
From what i can see, i also downloaded the TestForm from source section and it has the same issue: while the extraction progress works fine, the compression progress doesn't works since, as i already said, compressing event never get fired.

public void(){
            SevenZipCompressor zip = new SevenZipCompressor();
            zip.ArchiveFormat = OutArchiveFormat.Zip;
            zip.FastCompression = false;
            zip.CompressionLevel = CompressionLevel.Normal;
            zip.TempFolderPath = ConfigurationManager.AppSettings["ZIPTempPath"];
            //zip.Compressing += new EventHandler<ProgressEventArgs>(CreateZIPFile_Compressing);
            zip.Compressing += CreateZIPFile_Compressing;
            zip.FileCompressionStarted += new EventHandler<FileNameEventArgs>(CreateZIPFile_FileCompressionStarted);
            zip.CompressionFinished += new EventHandler<EventArgs>(CreateZIPFile_CompressionFinished);

            zip.BeginCompressDirectory(@"c:\temp", @"C:\");


        public void CreateZIPFile_Compressing(object sender, ProgressEventArgs e)
            loading.lblpercentage.Text = loading.progressbar.Value.ToString() + "%";

        void CreateZIPFile_FileCompressionStarted(object sender, FileNameEventArgs e)
            loading.lblpercentage.Visible = true;
            loading.progressbar.Visible = true;

        void CreateZIPFile_CompressionFinished(object sender, EventArgs e)

The compression works fine since i have a working file in my home dir, and both CompressionStarted and Finished got fired, while compressing doesn't.

How can i fix this?
Jun 20, 2012 at 6:40 PM
Edited Jun 20, 2012 at 6:41 PM

I've noticed issues with SevenZipSharp when using it with non-modal Forms. Try changing your loading.Show() to loading.ShowDialog().