How to completely release WorkflowRuntime resource

In case you need to create multiple WF 3.5/3.0 WorkflowRuntime objects, you may find the memory usage of the workflow application keep rising (memory leak) although you have disposed the objects.

To completely release the resource of WorkflowRuntime, we need to call StopRuntime method before it is disposed. For example:

using (WorkflowRuntime workflowRuntime = new WorkflowRuntime())

{

workflowRuntime.StopRuntime();

}

 

 

Regards,

Xin Jin