I am fresh to WF 4.0 and I encountered a strange issue.
My application uses a custom activity to read user's input, and it should be unloaded when it was idle:
WorkflowApplication wfApplication = new WorkflowApplication(new DemoActivity());
wfApplication.InstanceStore = SetupInstanceStore();
// Returning IdleAction.Unload instructs the WorkflowApplication to
// persists application state and remove it from memory.
wfApplication.PersistableIdle = e =>
Console.WriteLine("[DemoActivity]: Yes, unload me!");
wfApplication.Unloaded = e =>
View Complete Post