当我们使用c#在我的代码中使用sevenzip.dll时,geting错误运行时遇到致命错误

时间:2016-08-25 10:08:55

标签: c#

当我们在代码中使用sevenzip.dll时使用C#,geting error

  

运行时遇到了致命错误。错误的地址   位于线程0x1a70的0xdf7535b8处。错误代码是0xc0000005。   此错误可能是CLR中的错误,也可能是不安全或不可验证的错误   用户代码的一部分。此错误的常见来源包括用户   COM-interop或PInvoke的编组错误,可能会破坏   叠加。

我的代码是

 SevenZipExtractor.SetLibraryPath(@"D:\\Projects\\XML2U\\WindowsFormsApplication1\\WindowsFormsApplication1\\bin\\Debug\\SevenZipSharp.dll");
 SevenZipCompressor compressor = new SevenZipCompressor();
 compressor.ArchiveFormat = OutArchiveFormat.Zip;
 compressor.CompressionMode = CompressionMode.Create;
 compressor.TempFolderPath = System.IO.Path.GetTempPath();
 compressor.VolumeSize = 10000000;
 compressor.CompressDirectory(backupFolder, destination);

1 个答案:

答案 0 :(得分:-1)

SevenZipExtractor.SetLibraryPath调用中使用7zip.dll的路径。请参阅上一个问题How would i use Sevenzipsharp with this code?