Hello World C# Help

Visual Studio 2008 contains built-in support for creating workflows, and when you open the New Project dialog you will see a list of workflow project types as shown in Figure 43-1.

Figure 43-1

Figure 43-1

Select Sequential Workflow Console Application from the available templates (that will create a console application that hosts the workflow runtime) and a default workflow that you can then drag and drop activities onto. .

Next, drag a Code activity from the toolbox onto the design surface so that you have a workflow that looks like that shown in Figure 43-2.

Figure 43-2

Figure 43-2

The exclamation mark glyph on the top right of the activity indicates that a mandatory property of that activity has not been defined – in this case it is the Execute Code property, which indicates the method that will be called when the activity executes. You learn how to mark your own properties as mandatory in the section on activity validation. If you double-click the code activity, a method will be created for you in the code-behind class, and here you can use Console. WriteLine to output the “Hello World” string as shown in the following code snippet:

Capture

Posted on October 31, 2015 in Windows Workflow Foundation

Share the Story

Back to Top