Deserialization issue on Resume with System.Activities.Runtime.ExecutionPropertyManager
Closed this issue · 1 comments
We try to resume a WorkflowApplication instance from the FileInstanceStore of one of your examples and run into a Newtonsoft.Json.JsonSerializationException (see below).
The deserialization fails becaus there is no default constructor in the class System.Activities.Runtime.ExecutionPropertyManager.
However the [ExecutionPropertyManager] is flagged as [DataContract].
In my understanding it would be generally recommended to have a default constructor for each DataContract.
Adding a default constructor solves the issue for me.
ae2ff8a9-2258-4d80-b1e4-e6086fd5e5d0-InstanceMetadata.txt
ae2ff8a9-2258-4d80-b1e4-e6086fd5e5d0-InstanceData.txt
Finally my question, whether there is a reason for not having a default constructor on System.Activities.Runtime.ExecutionPropertyManager.
The exception message and stacktrace I get on resuming a WorkflowApplication instance from an existing GUID.
Message:
Newtonsoft.Json.JsonSerializationException : Unable to find a constructor to use for type System.Activities.Runtime.ExecutionPropertyManager. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path '['{urn:schemas-microsoft-com:System.Activities/4.0/properties}Workflow'].Value.bookmarkMgr.bookmarks.1.ActivityInstance.propertyManager.properties', line 147, position 29.
Stack Trace:
AsyncResult.End[TAsyncResult](IAsyncResult result) line 332
ExecuteAsyncResult.End(IAsyncResult result) line 1039
InstancePersistenceContext.OuterExecute(InstanceHandle initialInstanceHandle, InstancePersistenceCommand command, TimeSpan timeout) line 757
InstanceStore.Execute(InstanceHandle handle, InstancePersistenceCommand command, TimeSpan timeout) line 79
PersistenceManager.Load(TimeSpan timeout) line 412
WorkflowApplication.LoadValues(PersistenceManager persistenceManager, TimeoutHelper timeoutHelper, Boolean loadAny) line 1929
WorkflowApplication.LoadCore(TimeoutHelper timeoutHelper, Boolean loadAny, IDictionary`2 values) line 1765
WorkflowApplication.Load(Guid instanceId, TimeSpan timeout) line 1726
WorkflowApplication.Load(Guid instanceId) line 1684
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.