C# 与2012年相比';System.OutOfMemoryException';被抛出
我在处理归档文件时遇到此错误C# 与2012年相比';System.OutOfMemoryException';被抛出,c#,visual-studio-2012,out-of-memory,C#,Visual Studio 2012,Out Of Memory,我在处理归档文件时遇到此错误 System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.IO.MemoryStream.set_Capacity(Int32 value) at System.IO.MemoryStream.EnsureCapacity(Int32 value) at System.IO.MemoryStream.Write(Byte[] b
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize)
at System.IO.Stream.CopyTo(Stream destination)
at System.IO.Compression.ZipArchive.Init(Stream stream, ZipArchiveMode mode, Boolean leaveOpen)
at System.IO.Compression.ZipArchive..ctor(Stream stream, ZipArchiveMode mode, Boolean leaveOpen, Encoding entryNameEncoding)
这是我的密码
ZipArchive archive = ZipFile.OpenRead(packageFile);
var jbossZip = archive.GetEntry(jbossFileName);
请注意,我的存档文件大小为170mb。有人知道这个问题的解决方案吗?也展示一下你的工作……你是如何“处理”的?显示一些您使用的代码读取
https://www.nuget.org/packages/DotNetZip/
还是别的什么?展示一些code@JPHellemons他使用了System.IO.Compression.ZipArchive
。