How to: Debug XAML with the Workflow Designer

Workflows are defined in terms of XAML. The UI representation of workflow is built on top of the XAML tree defining the workflow. The debugging experience is similar to debugging workflows in the Windows Workflow Designer. For instance, while debugging XAML, the locals, watch, and threads windows work the same way as they do in Workflow Designer debugging. In addition, the call stack view during the XAML debugging is a line-based hierarchical view of the execution flow for the workflow.


If the XAML for a workflow is located in the same assembly as the activities, the assembly portion of the class names are not included. Without this portion of the class (activity) names, the XAML cannot be loaded at runtime. It is not recommended to define activities in the same namespace as the main project; otherwise, the XAML will need to be hand-edited after being edited in the designer.

To debug workflow XAML

  1. Open a workflow or activity project in Visual Studio.

  2. Set a breakpoint on the activity or activities you want to debug as described in How to: Set Breakpoints in Workflows.

  3. Right-click the .xaml file that contains your workflow definition and select View Code. You will see a breakpoint displayed on the same line as the XAML element declaration of the activity that you set the breakpoint on in the design view.

  4. Invoke the debugger as described in How to: Invoke the Workflow Debugger.

  5. When the code execution reaches one of your breakpoints, the XAML element associated with that breakpoint will be highlighted. To move to the next breakpoint, use the F10 or F11 key.

See Also

How to: Set Breakpoints in Workflows
How to: Invoke the Workflow Debugger