I have a custom workflow and several instances of that workflow are already running. I have made some changes to the workflow definition and now the persisted workflow cannot be deserialized. The proper solution would probably be to deploy older version of the assemblies, but I would prefer to go a safer route: just terminate all workflows that cannot be restored. I tried the following code:
However, it still tries to deserialize the workflow and throws a SerializationException with message of "The object with ID 177 implements the IObjectReference interface for which all dependencies cannot be resolved. The likely cause is two instances of IObjectReference that have a mutual dependency on each other."
I have a custom workflow and several instances of that workflow are already running. I have made some changes to the workflow definition and now the persisted workflow cannot be deserialized. The proper solution would probably be to deploy older version of the assemblies, but I would prefer to go a safer route: just terminate all workflows that cannot be restored. I tried the following code:
WorkflowSystem.InstanceHandler.TerminateInstance(workflowId, "cannot deserialize");
However, it still tries to deserialize the workflow and throws a SerializationException with message of "The object with ID 177 implements the IObjectReference interface for which all dependencies cannot be resolved. The likely cause is two instances of IObjectReference that have a mutual dependency on each other."
So how do I get rid of the offending workflows?