System.ExecutionEngineException on ExtractFile() from CHM


Try this for a CHM file -- any will do, even the SevenZipSharp documentation.
using (var o7z = new SevenZipExtractor(strPathToChmFile))
if (o7z.FilesCount != 0)
  for (var i = 0; i < o7z.FilesCount; i++)
     if (!o7z.ArchiveFileData[i].IsDirectory)
           using (var oFile = File.Create(strTempFileName))
              o7z.ExtractFile(i, oFile);
        catch { }
I end up getting two files out... #ITBITS and #SYSTEM... then comes the ExecutionEngineException. In the case of the SevenZipSharp documentation CHM, it's when i has reached 8. It may be the same for all CHM files, but I didn't check.


ComradeF wrote Jul 17, 2009 at 6:27 PM

Actually, now I seem to be getting it from CAB files as well. Not sure if it's all CAB files, but some at least.

markhor wrote Jul 20, 2009 at 2:03 PM

I failed to reproduce your issue. You do not use the 0.52 release, so upgrade it first. Sometimes it helps to recompile the library on your own system.
BTW, consider to use ExtractArchive method in case you just need to extract all files from CHM or CAB.

ComradeF wrote Jul 20, 2009 at 3:10 PM

I was using the 0.52 release. I will take a closer look at this later.

wrote Feb 22, 2013 at 1:16 AM