Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET.
This PR fixes an issue with DLASE when a MemoryStream instance is being used as an Activity.Attachment, e.g. a file. The ReadTimeout issue is caused when trying to serialize the non-serializable MemoryStream instance.
Specific Changes
Adds the AttachmentMemoryStreamConverter to serialize and deserialize a MemoryStream instance.
Serialize (WriteJson): It recursively searches and replaces all instances of MemoryStream to a serializable class, containing a type and a buffer array.
Deserialize (ReadJson): It recursivelly searches and converts all objects of type MemoryStream to a MemoryStream instance with the buffer array.
Adds unit tests to cover cases previous to the JsonConverter addition, and using the JsonConverter.
Testing
The following images show the bot working, and the unit tests passing.
Fixes #6771
Description
This PR fixes an issue with DLASE when a MemoryStream instance is being used as an Activity.Attachment, e.g. a file. The ReadTimeout issue is caused when trying to serialize the non-serializable MemoryStream instance.
Specific Changes
AttachmentMemoryStreamConverter
to serialize and deserialize a MemoryStream instance.Testing
The following images show the bot working, and the unit tests passing.