Skip to content

ZipArchive constructor remarks are incorrect for current .NET Framework and .NET Core #1128

Open
@ghost

Description

In the current documentation for ZipArchive's constructor, it states:

If the mode parameter is set to Read, the stream must support reading. If the mode parameter is set to Create, the stream must support writing. If the mode parameter is set to Update, the stream must support reading, writing, and seeking.

This is not correct in current versions of both .NET Core and .NET Framework due to a bug:
https://github.com/dotnet/corefx/issues/11497

The provided stream, if the mode is set to Create, must support writing and be able to get position information. Though most write-only streams do not support querying for position, you can create a stream subclass that tracks position to work around the issue, as described here:
https://stackoverflow.com/questions/16585488/writing-to-ziparchive-using-the-httpcontext-outputstream

Could the documentation be updated to explain how the class currently works? An example of the required wrapper class would also be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityarea-System.IO.CompressionuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions