dotnet / dotnet-api-docs

.NET API reference documentation (.NET 5+, .NET Core, .NET Framework)
https://docs.microsoft.com/dotnet/api/
Other
719 stars 1.56k forks source link

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

Open ghost opened 7 years ago

ghost commented 7 years ago

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.

BillWagner commented 6 years ago

raising priority because this has been bumped several sprints.