Trying to create a zip file in UWP using Ionic zip library. I manually added the Ionic.Zip.dll into the project. After doing that the below code gave an exception.
using (ZipFile zip = new ZipFile()) -------------> Exception on this line
{
zip.Password = "password";
zip.AddFile(file.Name);
zip.Save();
}
Exception : System.ArgumentException: ''IBM437' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.'
Followed the below link on this issue and modified project.json along with the below lines of code: .NET Core doesn't know about Windows 1252, how to fix?
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
var enc1252 = Encoding.GetEncoding(437);
But i get the below exception now on the same line. System.TypeLoadException: 'Could not load type 'System.IO.File' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.'
Not really sure whats going wrong. Need help.
Also is there any library available for UWP which helps in setting up a password for the zip file ? DotnetZip and CSharpZip both dont seem to support UWP project type.