How to debug Workflow Foundation with MEF using Visual Studio 2019

339 Views Asked by At

I have already read the documentation about WF here: https://learn.microsoft.com/de-de/dotnet/framework/windows-workflow-foundation/debugging-workflows

But I am unable to debug the workflow from Designer View loading the related assembly through MEF (Managed Extensibility Framework)

MyWorkflowActivity in Designer View containing a breakpoint

The associated assembly is correctly loaded containing the workflow xaml (due to build action "XamlAppDef") and is correctly initialized and executed using the below

 WorkflowApplication wfApp = new WorkflowApplication(new MyWorkflowNActivity(), param);
// [...]
wfApp.Run();

Also, breakpoints on custom Activities in code-behind do function as expected.

Any ideas on how to get the Workflow breakpoints to work in design mode?

UPDATE

An example solution can be downloaded here: https://github.com/ole1986/TestWF

Below output is supposed to appear in Debug console

Hello World
0

There are 0 best solutions below