Below is an example of the code I am using, but am having trouble finding a fix for the issue. I am VERY green with using C#, but I have referenced the library for 7Zip, although when I compile the code, I get the following error. There is a comment by the line being flagged in Visual Studio.
Error Message: Can not load 7-zip library or internal COM error! Message: library is invalid.
namespace SevenZipTest
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Compression for Multi-volumes has begun");
string dll = @"C:\Project\VsProgram\libs\SevenZipSharp.dll";
string source = @"SourceFilePath";
string output = @"ZipFileOutputPath";
SevenZipCompressor.SetLibraryPath(dll);
SevenZipCompressor compressor = new SevenZipCompressor();
compressor.ArchiveFormat = OutArchiveFormat.SevenZip;
compressor.CompressionMode = CompressionMode.Create;
compressor.TempFolderPath = System.IO.Path.GetTempPath();
compressor.VolumeSize = 10000000; // output file size in bytes
compressor.CompressDirectory(source, output); //This line is where I am getting the flag in the code that gives me the listed error message.
Console.ReadLine();
}
}
}
A few things to note about this is that I have done some research on it, and I have tried different approaches with the code structure too, but most of what I have seen has not provided me with a solution. This is probably a duplicate question, yet I haven't found a source for my purposes.
I've probably read almost every post I can find on this through Google.
With the fix applied in the code, I have been able to run the program, but I now receive an exception saying:
"The execution has failed due to the bug in the SevenZipSharp. Please report about it to http://sevenzipsharp.codeplex.com/WorkItem/List.aspx, post the release number and attach the archive."
I'm looking to see what I can find on this now.