I have ran into an issue with my SQL instance store attached to a WorkflowApplication
that is running. When I exit my application I'm calling an Unload()
on the WF app to persist it. I didn't think about it during design time, but it does makes sense, it's persisting an arg that was passed in to the WorkflowApplication constructor when instanced.
When the application runs, everything in the workflow works as expected. When I call Unload()
I get an unhandled exception that states that the arg is not serializable and needs [DataContractAttribute]
.
What's passed into the workflow is my applications custom logger object that I wrote so that the WF can log to disk in a uniform way that I prefer. How do I prevent the workflow app from persisting this one argument and persist everything else?
I'm sure something can be done with extensions but I'm having a hard time finding info on them or finding persistence examples for my scenario.