Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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:<unknown assembly> type:<unknown 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?