Click to Rate and Give Feedback
MSDN
MSDN Library
Task 1: Create the Simple Expense Report Application

In this task, you create the project file and Windows Form application that is used throughout the remainder of this tutorial. The project file contains the necessary assembly references that most Windows Workflow Foundation applications require. As you progress through the tutorial, you will edit this file to add new project files.

The Windows Form application contains the complete user interface for the tutorial. However, you will add additional logic to the Windows Form as you build the sequential workflow throughout the remaining exercises.

This task contains procedures for creating the files either using Visual Studio, or using a text editor with the standalone SDK.

Using Visual Studio

This section describes how to create the project and application files in Visual Studio.

To create the SimpleExpenseReport project

  1. In Visual Studio, click File, point to New, point to Project, If you want to create a C# project, select Visual C#, Windows and choose Windows Application and name the project SimpleExpenseReport. Click OK. If you want to create a Visual Basic project, select Visual Basic, Windows and follow the previous steps.

  2. In Solution Explorer, right click References and click Add Reference. In the .NET tab, click each of the followings and click OK to add them to the project.

    • System.Configuration
    • System.Workflow.Activities
    • System.Workflow.ComponentModel
    • System.Workflow.Runtime
    • System.Design
    • System.Drawing.Design
    • System.Transactions
    • System.Web
    • System.Web.Services

Creating and Running the Windows Form Application

Next, you create the Windows Forms application, which will contain the user interface for the remainder of the tutorial.

To create and run the simple expense report Windows Form application

  1. In Solution Explorer, double click Program.cs or Program.vb to open it in the code editor pane on the left.

  2. Add the following code for the Windows Form application.

    C#
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using System.Collections.Generic;
    using System.Workflow.Runtime;
    using System.Workflow.Runtime.Hosting;
    using System.Workflow.Activities;
    using System.Threading;
    
    namespace Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow
    {
        public class MainForm : Form
        {
            private System.Windows.Forms.Label label1;
            private System.Windows.Forms.TextBox result;
            private System.Windows.Forms.Label label2;
            private System.Windows.Forms.Button submitButton;
            private System.Windows.Forms.Label approvalState;
            private System.Windows.Forms.Button approveButton;
            private System.Windows.Forms.Button rejectButton;
            private System.Windows.Forms.TextBox amount;
            private System.Windows.Forms.Panel panel1;
    
            private System.ComponentModel.IContainer components = null;
    
            public MainForm()
            {
                InitializeComponent();
    
                // Collapse approve/reject panel
                this.Height = this.MinimumSize.Height;
            }
    
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            private void InitializeComponent()
            {
                this.label1 = new System.Windows.Forms.Label();
                this.result = new System.Windows.Forms.TextBox();
                this.label2 = new System.Windows.Forms.Label();
                this.submitButton = new System.Windows.Forms.Button();
                this.approvalState = new System.Windows.Forms.Label();
                this.approveButton = new System.Windows.Forms.Button();
                this.rejectButton = new System.Windows.Forms.Button();
                this.amount = new System.Windows.Forms.TextBox();
                this.panel1 = new System.Windows.Forms.Panel();
                this.panel1.SuspendLayout();
                this.SuspendLayout();
                // 
                // label1
                // 
                this.label1.AutoSize = true;
                this.label1.Location = new System.Drawing.Point(10, 13);
                this.label1.Name = "label1";
                this.label1.Size = new System.Drawing.Size(43, 13);
                this.label1.TabIndex = 1;
                this.label1.Text = "Amount";
                // 
                // result
                // 
                this.result.Location = new System.Drawing.Point(13, 70);
                this.result.Name = "result";
                this.result.ReadOnly = true;
                this.result.Size = new System.Drawing.Size(162, 20);
                this.result.TabIndex = 1;
                this.result.TabStop = false;
                // 
                // label2
                // 
                this.label2.AutoSize = true;
                this.label2.Location = new System.Drawing.Point(10, 54);
                this.label2.Name = "label2";
                this.label2.Size = new System.Drawing.Size(37, 13);
                this.label2.TabIndex = 3;
                this.label2.Text = "Result";
                // 
                // submitButton
                // 
                this.submitButton.Enabled = false;
                this.submitButton.Location = new System.Drawing.Point(56, 95);
                this.submitButton.Name = "submitButton";
                this.submitButton.Size = new System.Drawing.Size(75, 23);
                this.submitButton.TabIndex = 2;
                this.submitButton.Text = "Submit";
                this.submitButton.Click += new
                    System.EventHandler(this.submitButton_Click);
                // 
                // approvalState
                // 
                this.approvalState.AutoSize = true;
                this.approvalState.Location = new System.Drawing.Point(10, 9);
                this.approvalState.Name = "approvalState";
                this.approvalState.Size = new System.Drawing.Size(49, 13);
                this.approvalState.TabIndex = 4;
                this.approvalState.Text = "Approval";
                // 
                // approveButton
                // 
                this.approveButton.Enabled = false;
                this.approveButton.Location = new System.Drawing.Point(11, 25);
                this.approveButton.Name = "approveButton";
                this.approveButton.Size = new System.Drawing.Size(75, 23);
                this.approveButton.TabIndex = 0;
                this.approveButton.Text = "Approve";
                this.approveButton.Click += new
                    System.EventHandler(this.approveButton_Click);
                // 
                // rejectButton
                // 
                this.rejectButton.Enabled = false;
                this.rejectButton.Location = new System.Drawing.Point(86, 25);
                this.rejectButton.Name = "rejectButton";
                this.rejectButton.Size = new System.Drawing.Size(75, 23);
                this.rejectButton.TabIndex = 1;
                this.rejectButton.Text = "Reject";
                this.rejectButton.Click += new
                    System.EventHandler(this.rejectButton_Click);
                // 
                // amount
                // 
                this.amount.Location = new System.Drawing.Point(13, 29);
                this.amount.MaxLength = 9;
                this.amount.Name = "amount";
                this.amount.Size = new System.Drawing.Size(162, 20);
                this.amount.TabIndex = 0;
                this.amount.KeyPress += new
                    System.Windows.Forms.KeyPressEventHandler(this.amount_KeyPress);
                this.amount.TextChanged += new
                    System.EventHandler(this.amount_TextChanged);
                // 
                // panel1
                // 
                this.panel1.Controls.Add(this.approvalState);
                this.panel1.Controls.Add(this.approveButton);
                this.panel1.Controls.Add(this.rejectButton);
                this.panel1.Location = new System.Drawing.Point(7, 124);
                this.panel1.Name = "panel1";
                this.panel1.Size = new System.Drawing.Size(172, 66);
                this.panel1.TabIndex = 8;
                // 
                // MainForm
                // 
                this.AcceptButton = this.submitButton;
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(187, 201);
                this.MinimumSize = new System.Drawing.Size(197, 155);
                this.Controls.Add(this.result);
                this.Controls.Add(this.label2);
                this.Controls.Add(this.panel1);
                this.Controls.Add(this.amount);
                this.Controls.Add(this.submitButton);
                this.Controls.Add(this.label1);
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
                this.MaximizeBox = false;
                this.MinimizeBox = false;
                this.Name = "MainForm";
                this.Text = "Simple Expense Report";
                this.panel1.ResumeLayout(false);
                this.panel1.PerformLayout();
                this.ResumeLayout(false);
                this.PerformLayout();
    
            }
    
            private void submitButton_Click(object sender, EventArgs e)
            {
            }
    
            private void approveButton_Click(object sender, EventArgs e)
            {
            }
    
            private void rejectButton_Click(object sender, EventArgs e)
            {
            }
    
            private void amount_KeyPress(object sender, KeyPressEventArgs e)
            {
                if (!Char.IsControl(e.KeyChar) && (!Char.IsDigit(e.KeyChar)))
                    e.KeyChar = Char.MinValue;
            }
    
            private void amount_TextChanged(object sender, EventArgs e)
            {
                submitButton.Enabled = amount.Text.Length > 0;
            }
        }
    
        static class Program
        {
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.Run(new MainForm());
            }
        }
    }
    
  3. Add the following code for the Windows Form application.

    C#
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using System.Collections.Generic;
    using System.Workflow.Runtime;
    using System.Workflow.Runtime.Hosting;
    using System.Workflow.Activities;
    using System.Threading;
    
    namespace Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow
    {
        public class MainForm : Form
        {
            private System.Windows.Forms.Label label1;
            private System.Windows.Forms.TextBox result;
            private System.Windows.Forms.Label label2;
            private System.Windows.Forms.Button submitButton;
            private System.Windows.Forms.Label approvalState;
            private System.Windows.Forms.Button approveButton;
            private System.Windows.Forms.Button rejectButton;
            private System.Windows.Forms.TextBox amount;
            private System.Windows.Forms.Panel panel1;
    
            private System.ComponentModel.IContainer components = null;
    
            public MainForm()
            {
                InitializeComponent();
    
                // Collapse approve/reject panel
                this.Height = this.MinimumSize.Height;
            }
    
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            private void InitializeComponent()
            {
                this.label1 = new System.Windows.Forms.Label();
                this.result = new System.Windows.Forms.TextBox();
                this.label2 = new System.Windows.Forms.Label();
                this.submitButton = new System.Windows.Forms.Button();
                this.approvalState = new System.Windows.Forms.Label();
                this.approveButton = new System.Windows.Forms.Button();
                this.rejectButton = new System.Windows.Forms.Button();
                this.amount = new System.Windows.Forms.TextBox();
                this.panel1 = new System.Windows.Forms.Panel();
                this.panel1.SuspendLayout();
                this.SuspendLayout();
                // 
                // label1
                // 
                this.label1.AutoSize = true;
                this.label1.Location = new System.Drawing.Point(10, 13);
                this.label1.Name = "label1";
                this.label1.Size = new System.Drawing.Size(43, 13);
                this.label1.TabIndex = 1;
                this.label1.Text = "Amount";
                // 
                // result
                // 
                this.result.Location = new System.Drawing.Point(13, 70);
                this.result.Name = "result";
                this.result.ReadOnly = true;
                this.result.Size = new System.Drawing.Size(162, 20);
                this.result.TabIndex = 1;
                this.result.TabStop = false;
                // 
                // label2
                // 
                this.label2.AutoSize = true;
                this.label2.Location = new System.Drawing.Point(10, 54);
                this.label2.Name = "label2";
                this.label2.Size = new System.Drawing.Size(37, 13);
                this.label2.TabIndex = 3;
                this.label2.Text = "Result";
                // 
                // submitButton
                // 
                this.submitButton.Enabled = false;
                this.submitButton.Location = new System.Drawing.Point(56, 95);
                this.submitButton.Name = "submitButton";
                this.submitButton.Size = new System.Drawing.Size(75, 23);
                this.submitButton.TabIndex = 2;
                this.submitButton.Text = "Submit";
                this.submitButton.Click += new
                    System.EventHandler(this.submitButton_Click);
                // 
                // approvalState
                // 
                this.approvalState.AutoSize = true;
                this.approvalState.Location = new System.Drawing.Point(10, 9);
                this.approvalState.Name = "approvalState";
                this.approvalState.Size = new System.Drawing.Size(49, 13);
                this.approvalState.TabIndex = 4;
                this.approvalState.Text = "Approval";
                // 
                // approveButton
                // 
                this.approveButton.Enabled = false;
                this.approveButton.Location = new System.Drawing.Point(11, 25);
                this.approveButton.Name = "approveButton";
                this.approveButton.Size = new System.Drawing.Size(75, 23);
                this.approveButton.TabIndex = 0;
                this.approveButton.Text = "Approve";
                this.approveButton.Click += new
                    System.EventHandler(this.approveButton_Click);
                // 
                // rejectButton
                // 
                this.rejectButton.Enabled = false;
                this.rejectButton.Location = new System.Drawing.Point(86, 25);
                this.rejectButton.Name = "rejectButton";
                this.rejectButton.Size = new System.Drawing.Size(75, 23);
                this.rejectButton.TabIndex = 1;
                this.rejectButton.Text = "Reject";
                this.rejectButton.Click += new
                    System.EventHandler(this.rejectButton_Click);
                // 
                // amount
                // 
                this.amount.Location = new System.Drawing.Point(13, 29);
                this.amount.MaxLength = 9;
                this.amount.Name = "amount";
                this.amount.Size = new System.Drawing.Size(162, 20);
                this.amount.TabIndex = 0;
                this.amount.KeyPress += new
                    System.Windows.Forms.KeyPressEventHandler(this.amount_KeyPress);
                this.amount.TextChanged += new
                    System.EventHandler(this.amount_TextChanged);
                // 
                // panel1
                // 
                this.panel1.Controls.Add(this.approvalState);
                this.panel1.Controls.Add(this.approveButton);
                this.panel1.Controls.Add(this.rejectButton);
                this.panel1.Location = new System.Drawing.Point(7, 124);
                this.panel1.Name = "panel1";
                this.panel1.Size = new System.Drawing.Size(172, 66);
                this.panel1.TabIndex = 8;
                // 
                // MainForm
                // 
                this.AcceptButton = this.submitButton;
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(187, 201);
                this.MinimumSize = new System.Drawing.Size(197, 155);
                this.Controls.Add(this.result);
                this.Controls.Add(this.label2);
                this.Controls.Add(this.panel1);
                this.Controls.Add(this.amount);
                this.Controls.Add(this.submitButton);
                this.Controls.Add(this.label1);
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
                this.MaximizeBox = false;
                this.MinimizeBox = false;
                this.Name = "MainForm";
                this.Text = "Simple Expense Report";
                this.panel1.ResumeLayout(false);
                this.panel1.PerformLayout();
                this.ResumeLayout(false);
                this.PerformLayout();
    
            }
    
            private void submitButton_Click(object sender, EventArgs e)
            {
            }
    
            private void approveButton_Click(object sender, EventArgs e)
            {
            }
    
            private void rejectButton_Click(object sender, EventArgs e)
            {
            }
    
            private void amount_KeyPress(object sender, KeyPressEventArgs e)
            {
                if (!Char.IsControl(e.KeyChar) && (!Char.IsDigit(e.KeyChar)))
                    e.KeyChar = Char.MinValue;
            }
    
            private void amount_TextChanged(object sender, EventArgs e)
            {
                submitButton.Enabled = amount.Text.Length > 0;
            }
        }
    
        static class Program
        {
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.Run(new MainForm());
            }
        }
    }
    
  4. Add the following code for the Windows Form application.

    C#
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using System.Collections.Generic;
    using System.Workflow.Runtime;
    using System.Workflow.Runtime.Hosting;
    using System.Workflow.Activities;
    using System.Threading;
    
    namespace Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow
    {
        public class MainForm : Form
        {
            private System.Windows.Forms.Label label1;
            private System.Windows.Forms.TextBox result;
            private System.Windows.Forms.Label label2;
            private System.Windows.Forms.Button submitButton;
            private System.Windows.Forms.Label approvalState;
            private System.Windows.Forms.Button approveButton;
            private System.Windows.Forms.Button rejectButton;
            private System.Windows.Forms.TextBox amount;
            private System.Windows.Forms.Panel panel1;
    
            private System.ComponentModel.IContainer components = null;
    
            public MainForm()
            {
                InitializeComponent();
    
                // Collapse approve/reject panel
                this.Height = this.MinimumSize.Height;
            }
    
            protected override void Dispose(bool disposing)
            {
                if (disposing && (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            private void InitializeComponent()
            {
                this.label1 = new System.Windows.Forms.Label();
                this.result = new System.Windows.Forms.TextBox();
                this.label2 = new System.Windows.Forms.Label();
                this.submitButton = new System.Windows.Forms.Button();
                this.approvalState = new System.Windows.Forms.Label();
                this.approveButton = new System.Windows.Forms.Button();
                this.rejectButton = new System.Windows.Forms.Button();
                this.amount = new System.Windows.Forms.TextBox();
                this.panel1 = new System.Windows.Forms.Panel();
                this.panel1.SuspendLayout();
                this.SuspendLayout();
                // 
                // label1
                // 
                this.label1.AutoSize = true;
                this.label1.Location = new System.Drawing.Point(10, 13);
                this.label1.Name = "label1";
                this.label1.Size = new System.Drawing.Size(43, 13);
                this.label1.TabIndex = 1;
                this.label1.Text = "Amount";
                // 
                // result
                // 
                this.result.Location = new System.Drawing.Point(13, 70);
                this.result.Name = "result";
                this.result.ReadOnly = true;
                this.result.Size = new System.Drawing.Size(162, 20);
                this.result.TabIndex = 1;
                this.result.TabStop = false;
                // 
                // label2
                // 
                this.label2.AutoSize = true;
                this.label2.Location = new System.Drawing.Point(10, 54);
                this.label2.Name = "label2";
                this.label2.Size = new System.Drawing.Size(37, 13);
                this.label2.TabIndex = 3;
                this.label2.Text = "Result";
                // 
                // submitButton
                // 
                this.submitButton.Enabled = false;
                this.submitButton.Location = new System.Drawing.Point(56, 95);
                this.submitButton.Name = "submitButton";
                this.submitButton.Size = new System.Drawing.Size(75, 23);
                this.submitButton.TabIndex = 2;
                this.submitButton.Text = "Submit";
                this.submitButton.Click += new
                    System.EventHandler(this.submitButton_Click);
                // 
                // approvalState
                // 
                this.approvalState.AutoSize = true;
                this.approvalState.Location = new System.Drawing.Point(10, 9);
                this.approvalState.Name = "approvalState";
                this.approvalState.Size = new System.Drawing.Size(49, 13);
                this.approvalState.TabIndex = 4;
                this.approvalState.Text = "Approval";
                // 
                // approveButton
                // 
                this.approveButton.Enabled = false;
                this.approveButton.Location = new System.Drawing.Point(11, 25);
                this.approveButton.Name = "approveButton";
                this.approveButton.Size = new System.Drawing.Size(75, 23);
                this.approveButton.TabIndex = 0;
                this.approveButton.Text = "Approve";
                this.approveButton.Click += new
                    System.EventHandler(this.approveButton_Click);
                // 
                // rejectButton
                // 
                this.rejectButton.Enabled = false;
                this.rejectButton.Location = new System.Drawing.Point(86, 25);
                this.rejectButton.Name = "rejectButton";
                this.rejectButton.Size = new System.Drawing.Size(75, 23);
                this.rejectButton.TabIndex = 1;
                this.rejectButton.Text = "Reject";
                this.rejectButton.Click += new
                    System.EventHandler(this.rejectButton_Click);
                // 
                // amount
                // 
                this.amount.Location = new System.Drawing.Point(13, 29);
                this.amount.MaxLength = 9;
                this.amount.Name = "amount";
                this.amount.Size = new System.Drawing.Size(162, 20);
                this.amount.TabIndex = 0;
                this.amount.KeyPress += new
                    System.Windows.Forms.KeyPressEventHandler(this.amount_KeyPress);
                this.amount.TextChanged += new
                    System.EventHandler(this.amount_TextChanged);
                // 
                // panel1
                // 
                this.panel1.Controls.Add(this.approvalState);
                this.panel1.Controls.Add(this.approveButton);
                this.panel1.Controls.Add(this.rejectButton);
                this.panel1.Location = new System.Drawing.Point(7, 124);
                this.panel1.Name = "panel1";
                this.panel1.Size = new System.Drawing.Size(172, 66);
                this.panel1.TabIndex = 8;
                // 
                // MainForm
                // 
                this.AcceptButton = this.submitButton;
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(187, 201);
                this.MinimumSize = new System.Drawing.Size(197, 155);
                this.Controls.Add(this.result);
                this.Controls.Add(this.label2);
                this.Controls.Add(this.panel1);
                this.Controls.Add(this.amount);
                this.Controls.Add(this.submitButton);
                this.Controls.Add(this.label1);
                this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
                this.MaximizeBox = false;
                this.MinimizeBox = false;
                this.Name = "MainForm";
                this.Text = "Simple Expense Report";
                this.panel1.ResumeLayout(false);
                this.panel1.PerformLayout();
                this.ResumeLayout(false);
                this.PerformLayout();
    
            }
    
            private void submitButton_Click(object sender, EventArgs e)
            {
            }
    
            private void approveButton_Click(object sender, EventArgs e)
            {
            }
    
            private void rejectButton_Click(object sender, EventArgs e)
            {
            }
    
            private void amount_KeyPress(object sender, KeyPressEventArgs e)
            {
                if (!Char.IsControl(e.KeyChar) && (!Char.IsDigit(e.KeyChar)))
                    e.KeyChar = Char.MinValue;
            }
    
            private void amount_TextChanged(object sender, EventArgs e)
            {
                submitButton.Enabled = amount.Text.Length > 0;
            }
        }
    
        static class Program
        {
            [STAThread]
            static void Main()
            {
                Application.EnableVisualStyles();
                Application.Run(new MainForm());
            }
        }
    }
    
  5. Click Debug, point to Start Debugging, your Windows Form application should look similar to the following figure:

    Simple Expense Report Sample Dialog Box

Using a Text Editor

This section describes how to create the project and application files using a text editor outside Visual Studio.

Follow these steps to create the project file for the expense report application. If you are using C#, give the project file the .csproj file name extension. If you are using Visual Basic, give it a .vbproj file name extension.

To create the SimpleExpenseReport project file

  1. In your project directory, create a new file named SimpleExpenseReport.

    Use the .csproj extension for a C# project or the .vbproj extension for a Visual Basic project.

  2. Copy and paste the following code into this project file.

    Visual Basic
    <?xml version="1.0" encoding="utf-8"?>
    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
        <ProductVersion>8.0.50727</ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>{37000091-C9D4-4954-B65E-5EED0AD2CD55}</ProjectGuid>
        <ProjectTypeGuids>{D59BE175-2ED0-4C54-BE3D-CDAA9F3214C8};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
        <OutputType>WinExe</OutputType>
        <StartupObject>
        </StartupObject>
        <RootNamespace>SimpleExpenseReport</RootNamespace>
        <AssemblyName>SimpleExpenseReport</AssemblyName>
        <MyType>WindowsFormsWithCustomSubMain</MyType>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <DefineDebug>true</DefineDebug>
        <DefineTrace>true</DefineTrace>
        <IncrementalBuild>true</IncrementalBuild>
        <OutputPath>bin\</OutputPath>
        <DefineConstants>_MyType="Windows"</DefineConstants>
        <DocumentationFile>SimpleExpenseReport.xml</DocumentationFile>
        <UseVSHostingProcess>false</UseVSHostingProcess>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <DebugSymbols>false</DebugSymbols>
        <DefineDebug>false</DefineDebug>
        <DefineTrace>true</DefineTrace>
        <IncrementalBuild>false</IncrementalBuild>
        <Optimize>true</Optimize>
        <OutputPath>bin\</OutputPath>
        <DefineConstants>_MyType="Windows"</DefineConstants>
        <DocumentationFile>SimpleExpenseReport.xml</DocumentationFile>
        <UseVSHostingProcess>false</UseVSHostingProcess>
      </PropertyGroup>
      <ItemGroup>
        <Reference Include="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <Name>System</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <Name>System.Data</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Deployment" />
        <Reference Include="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <Name>System.Transactions</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <Name>System.Xml</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Workflow.Activities, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
          <Name>System.Workflow.Activities</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Workflow.ComponentModel, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
          <Name>System.Workflow.ComponentModel</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
          <Name>System.Workflow.Runtime</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
          <Name>System.Design</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
          <Name>System.Drawing</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
          <Name>System.Drawing.Design</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Windows.Forms">
          <Name>System.Windows.Forms</Name>
        </Reference>
        <Reference Include="mscorlib">
          <Name>mscorlib</Name>
        </Reference>
        <Reference Include="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86">
          <Name>System.Web</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
        <Reference Include="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
          <Name>System.Web.Services</Name>
          <SpecificVersion>True</SpecificVersion>
        </Reference>
      </ItemGroup>
      <ItemGroup>
        <Import Include="Microsoft.VisualBasic" />
        <Import Include="System" />
        <Import Include="System.Collections" />
        <Import Include="System.Data" />
        <Import Include="System.Diagnostics" />
      </ItemGroup>
      <ItemGroup>
        <Compile Include="Program.vb">
          <SubType>Form</SubType>
        </Compile>
      </ItemGroup>
      <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.Targets" />
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.VisualBasic.Targets" />
      <PropertyGroup>
        <PreBuildEvent>
        </PreBuildEvent>
        <PostBuildEvent>
        </PostBuildEvent>
      </PropertyGroup>
    </Project> 
    

    C#
    <?xml version="1.0" encoding="utf-8"?>
    <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
        <ProductVersion>8.0.50727</ProductVersion>
        <SchemaVersion>2.0</SchemaVersion>
        <ProjectGuid>{37000091-C9D4-4954-B65E-5EED0AD2CD55}</ProjectGuid>
        <OutputType>WinExe</OutputType>
        <RootNamespace>Microsoft.Samples.Workflow.Tutorials.SequentialWorkflow</RootNamespace>
        <AssemblyName>SimpleExpenseReport</AssemblyName>
        <ProjectTypeGuids>{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
        <WarningLevel>4</WarningLevel>
        <StartupObject>
        </StartupObject>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
        <DebugSymbols>true</DebugSymbols>
        <DebugType>full</DebugType>
        <Optimize>false</Optimize>
        <OutputPath>.\bin\Debug\</OutputPath>
        <DefineConstants>DEBUG;TRACE</DefineConstants>
        <UseVSHostingProcess>false</UseVSHostingProcess>
      </PropertyGroup>
      <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
        <DebugSymbols>false</DebugSymbols>
        <Optimize>true</Optimize>
        <OutputPath>.\bin\Release\</OutputPath>
        <DefineConstants>TRACE</DefineConstants>
        <UseVSHostingProcess>false</UseVSHostingProcess>
      </PropertyGroup>
      <ItemGroup>
        <Reference Include="System.configuration" />
        <Reference Include="System.Windows.Forms" />
        <Reference Include="System.Workflow.Activities" />
        <Reference Include="System.Workflow.ComponentModel" />
        <Reference Include="System.Workflow.Runtime" />
        <Reference Include="System" />
        <Reference Include="System.Data" />
        <Reference Include="System.Design" />
        <Reference Include="System.Drawing" />
        <Reference Include="System.Drawing.Design" />
        <Reference Include="System.Transactions" />
        <Reference Include="System.Xml" />
        <Reference Include="System.Web" />
        <Reference Include="System.Web.Services" />
      </ItemGroup>
      <ItemGroup>
        <Compile Include="Program.cs">
          <SubType>Form</SubType>
        </Compile>
      </ItemGroup>
      <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
      <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.Targets" />
    </Project>
    

Compiling the Code

  1. For information about compiling your code, see Compiling the Code.

In Task 2: Create the Sequential Workflow, you create the workflow source file that you can use for the rest of the tutorial.

See Also



Copyright © 2007 by Microsoft Corporation. All rights reserved.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker