I have a workflow service which receives a stream through a ReceiveRequest activity.
The workflow works well, but if I try to persist it I have an exception (Cannot access a closed stream) which I think is related to the stream object.
The object received is similar to this:
public class MessageContext
{
public Stream Content{get;set;}
//..other properties
}
and the object sent is a MemoryStream (which is added to Known service types).
Anyone can help me?
If you’re persisting your workflow, you want to make sure all your variables are serializable. I’ve had to refactor a previous workflow to do this, or make sure any non basic objects were set to null before the workflow could idle.
I prefered just sending basic types after that, setting variables to null just didn’t feel right.