-2

when we use sevenzip.dll in my code using C#, geting error

The runtime has encountered a fatal error. The address of the error was at 0xdf7535b8, on thread 0x1a70. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

My code is

 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);
isalgueiro
  • 1,973
  • 16
  • 20

1 Answers1

-1

Use the path to 7zip.dll in SevenZipExtractor.SetLibraryPath call. See this previous question How would i use Sevenzipsharp with this code?

Community
  • 1
  • 1
isalgueiro
  • 1,973
  • 16
  • 20
  • 1
    Best not to hard-code that path, either. You don't even need to call the method at all, once you've added a reference to `SevenZipSharp, assuming the two DLLs are in the same directory (and they should be). – Cody Gray - on strike Aug 25 '16 at 11:33