Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

SevenZipSharp library not working on Xamarin forms #179

Open
anitharajasri opened this issue Jan 19, 2023 · 0 comments
Open

SevenZipSharp library not working on Xamarin forms #179

anitharajasri opened this issue Jan 19, 2023 · 0 comments

Comments

@anitharajasri
Copy link

We are working on a Xamarin project that needs to split a large file into smaller files with specified file sizes. we tried to use the SeveZipSharp library by installing the squid-box-sevenzipsharp NuGet package which supports xamarin forms for compressing and decompressing large files.
But while we compress the large files, we got an exception: kernel32.dll assembly: type: member:(null)
For your reference, this is our code,
try
{
string dll = @"/Users/macmini3/Documents/7z/7z.dll";
string filename = @"/Users/macmini3/Documents/FileFolder";
string output = @"/Users/macmini3/Documents/Files/zipped.7z";

            SevenZipCompressor.SetLibraryPath(dll);
            SevenZipCompressor compressor = new SevenZipCompressor();
            compressor.ArchiveFormat = OutArchiveFormat.SevenZip;
            compressor.TempFolderPath = Path.GetTempPath();
            compressor.CompressionMode = CompressionMode.Create;
           // compressor.CompressionLevel = CompressionLevel.Fast;
            //compressor.CompressionMethod = CompressionMethod.Lzma2;
            //compressor.ZipEncryptionMethod = ZipEncryptionMethod.Aes256;
            compressor.VolumeSize = 5000000;
            var assemblyDllPath = compressor.TempFolderPath + "32-7z.dll";
            //var assemblyDllPath = compressor.TempFolderPath + "64-7z.dll";
            File.Copy(dll, assemblyDllPath, overwrite: true);
          //  SevenZipExtractor.SetLibraryPath(dll);

            compressor.CompressDirectory(filename, output);
        }
        catch (Exception ex)
        {
          // throws an exception, Kernel32.dll assembly:<unknown assembly> type:<unknown type> member:(null)
        }

We are using Visual Studio Community 2019 for mac (Version: 8.10.25) and Xamarin Forms (Version: 4.5.0.356)

  1. Can anyone please help us to resolve this issue?
  2. Does the SevenZipSharp library support the Xamarin Forms project?
  3. Can anyone suggest any other thirty-party library (Paid/Free) to split large files into smaller files that support Xamarin Forms?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant