Debugging a WF program

In this task, we will debug a WF program.

How to do it...

  1. Create a workflow project:

    Create a new Workflow Console Application project under the Charpter01 solution. Name the project as DebugWFProgram. In the opening WF designer panel, author a workflow as shown in the following screenshot:

    How to do it...
  2. Create workflow host code:

    Open Program.cs file and change the code to:

    using System.Activities;
    using System.Activities.Statements;
    
    namespace DebugWFProgram{
        class Program{
            static void Main(string[] args){
                WorkflowInvoker.Invoke(new Workflow1()
                { 
                    InMessage="In Message"
                });
            }
        }
    }
    
  3. Set a debug break point:

    Right-click an activity and select Breadpoint ...

Get Microsoft Windows Workflow Foundation 4.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.