I am using SevenZipExtractor. When i extract multiple files in multiple threads some times it throws error.
The given key was not present in the dictionary or
Could not extract files! Message: File is corrupted. Crc check has failed.
7zip compressed file is not an issue because i if extract single file it works fine. Only when i extract 3 or 4 files in multiple threads i am getting above error.
private void ExtractZipFiles(string m_zipFilePath, string m_destinationFolderPath)
{
try
{
SevenZip.SevenZipExtractor.SetLibraryPath(Path.Combine(Application.StartupPath, "7za.dll"));
SevenZip.SevenZipExtractor zipFile = new SevenZip.SevenZipExtractor(m_zipFilePath);
zipFile.FileExtractionStarted += new EventHandler<SevenZip.FileInfoEventArgs>(OnZipFileFileExtractionStarted);
zipFile.ExtractArchive(m_destinationFolderPath);
}
catch (Exception)
{
// error here.
}
}
void OnZipFileFileExtractionStarted(object sender, SevenZip.FileInfoEventArgs e)
{
Debug.WriteLine(e.FileInfo.ToString());
}
How can fix above error.