Free Support Forum -

Archive Constructor: IndexOutOfRangeException

Hello. We are using the current version of Aspose.ZIP for .NET (19.12). Running under .NET framework 4.7.2.

It works on many files but in some cases it fails with an IndexOutOfRangeException when calling the constructor.

Code as follows:

new Archive(@"C:\temp\testunzip\")

Note that the failure is produced by the constructor; the call to “ExtractToDirectory” is never reached.

The ZIP file causing this issue is attached. I don’t believe that there is anything unusual about this ZIP. It is viewable and extractable by Windows Explorer. (51.1 KB)

Error as follows:

Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
  at   .(Byte[] )
  at   .()
  at   .(BinaryReader )
  at   .(Int64 , UInt64 )
  at Aspose.Zip.Archive.(Stream , ArchiveLoadOptions )
  at Aspose.Zip.Archive..ctor(Stream sourceStream, ArchiveLoadOptions loadOptions, ArchiveEntrySettings newEntrySettings)
  at Aspose.Zip.Archive..ctor(String path, ArchiveLoadOptions loadOptions, ArchiveEntrySettings newEntrySettings)


We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as ZIPNET-471. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.


Thanks for your patience. It is to inform you that this issue has been resolved and its fix is available in the latest version of Aspose.ZIP for .NET 20.3. So, please use Aspose.ZIP for .NET 20.3.