Cannot close stream until all bytes are written – C#

Cannot close stream until all bytes are written – C#

This error is raised when the position of stream or memory stream object is set at the end of stream. To resolve the issue either you can set the position to “o” as shown below.

If this doesn’t work, you can re-create the memory stream as shown below

One thought on “Cannot close stream until all bytes are written – C#

  1. lisette.bottrill@gmail.com'
    age renew review
    says:
    Reply

    This website really has all of the information I needed
    about this subject and didn’t know who to ask.

Leave a reply

Your email address will not be published. Required fields are marked *