When I want to Compress the Large files (ex: an iso file about 2GB) using .net System.IO.Compress
, It will show Exception and stop working.
It my Code:
using (ZipArchive zipArchive = ZipFile.Open(zipFile, ZipArchiveMode.Update))
{
zipArchive.CreateEntryFromFile(@"C:\test1.iso", "test1.iso", CompressionLevel.NoCompression);
zipArchive.CreateEntryFromFile(@"C:\test2.iso", "test2.iso", CompressionLevel.NoCompression);
}
Exception:
An unhandled exception of type 'System.OutOfMemoryException' occurred in mscorlib.dll
How can I do to slove this problem in x86 system? (in x64 it can run,but my app will be x86 app).