FREE BOOK

Chapter 1: Workflow Program

Posted by Packt Publishing Free Book | WF October 15, 2010
In this chapter we will see how to create WF program with different methods.

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:



  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 Breakpoint | Insert Breakpoint to add debug break point.

  4. Debug it:
    Press F5 to debug the WF Program; we can refer the following screenshot:

There's more...

We can also debug an XAML Workflow. Open Workflow with the XML editor, insert some breakpoints, then press F5; we will see the breakpoints as shown in the following screenshot:

Total Pages : 13 910111213

comments