-2
,當我們用C#中使用sevenzip.dll在我的代碼,歌廳錯誤當我們使用C#,歌廳錯誤運行時遇到一個致命錯誤
使用sevenzip.dll在我的代碼運行時遇到致命錯誤。錯誤 的地址位於0xdf7535b8,位於線程0x1a70。錯誤代碼是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);
最好不要硬編碼的路徑,要麼。一旦添加了對SevenZipSharp的引用,假設這兩個DLL位於相同的目錄(它們應該是),則根本不需要調用該方法。 –