Creating the first WF program: HelloWorkflow
In this task we will create our first Workflow to print "Hello Workflow" to the console application.
How to do it...
How it works...
When we press Ctrl+F5, Visual Studio saves the current project, and then it runs the project from the Main method in the Program.cs file.
WorkflowInvoker.Invoke(new HelloWorkflow1());
The preceding statement starts the Workflow. After the Workflow starts running, the WriteLine activity prints the "Hello Workflow" to the Console Application.
The Workflow we created in WF Designer is actually an XML file. We can open Workflow1.xaml with an XML editor to check it.
Right-click on Workflow1.xaml then click Open With..., and choose XML Editor to open Workflow1.xaml as an XML file.
All XAML files will be compiled to .dll or .exe files. That is why when we press Ctrl+F5, the program just runs like a normal C# program.
There's more...
So far, there are no officially published WF4 Designer add-ins for Visual Studio 2008. We need a copy of Visual Studio 2010 installed on our computer to use WF4 Designer, otherwise we can only create Workflows by imperative code or by writing pure XAML files.