When I create a Flowchart workflow with a delay, and run it via WorkflowApplication.Run(), then try to terminate the main program thread, I would expect the workflow would terminate without a problem because the Delay has relinquished the ThreadPool thread.
But it does not. If I don't cancel every running workflow, the application will not terminate.
I should say that when my process ends, I just want the workflows to go away. I don't need to persist them. When I run the program again, I'll just start over.
To demo this problem, I created a simple app. I run a flowchart workflow that has a 10-second Delay, then a WriteLine("here") then loops back to the delay. There's no way out of this loop.
I know I can keep a list of all the WorkflowApplication instances, and loop through them when I stop. But why do I need to? What is keeping my process from terminating? Is there a way to change this?
I invoke the workflow using this code:
static void Main(string args)
WorkflowApplication app = new WorkflowApplication(
View Complete Post