I am trying to debug an error for System.Activities.WorkflowApplication. This is my code.
var instanceStore = SetupSqlpersistenceStore();
var workflowApplicationInstance = WorkflowApplication.GetInstance(workflowInstance.WorkflowInstanceGuid.Value, instanceStore);
var wf = WorkflowFactory.GetInstance((WorkflowTypes) workflow.WorkflowTypeId, workflowApplicationInstance.DefinitionIdentity);
var wa = new WorkflowApplication(wf, workflowApplicationInstance.DefinitionIdentity);
wa.Extensions.Add(GetSqlTracker(databasename));
wa.InstanceStore = instanceStore;
int count = 0;
wa.PersistableIdle = (e) =>
{
//persists application state and remove it from memory
if (count > 0)
return PersistableIdleAction.Unload;
count++;
return PersistableIdleAction.None;
};
wa.Unloaded = (workflowApplicationEventArgs) => waitHandler.Set();
wa.Load(workflowApplicationInstance);
At the last line
wa.Load(workflowApplicationInstance);
I get the following error.
'EnvironmentLocationReference Int32>' is not of type 'HbbManualActivity
1'. When loading this instance you must ensure that the activity with name 'EnvironmentLocationReference<Int32>' implements 'HbbManualActivity1'.
I do not know what EnvironmentLocationReference Int32> means. HbbManualActivity is a class declared as follows but I cannot find it used in the solution.
public class HbbManualActivity<T> : NativeActivity<T>
I tried changing the wa.Load() method to use InstanceID instead of a wofklowApplicationInstance but I get a different error saying that the InstanceStore is locked to one owner.