Task 1: Create the Simple Order Form Project FileĀ
In this task, you create the project file that is used throughout the rest 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.
Creating the Project File
Follow these steps to create the order form project file. If you are using C#, give the project file a .csproj file name extension. If you are using Visual Basic, use the .vbproj file name extension.
To create the Simple Order Form project file
Create a new file named StateMachineWorkflow.
Use the .csproj file name extension if you are creating a C# project, and the .vbproj file name extension for Visual Basic projects.
Copy and paste the following code into the project file.
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="https://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>{C01BEB66-B7C1-4E71-855A-A8B869233BB7}</ProjectGuid> <ProjectTypeGuids>{D59BE175-2ED0-4C54-BE3D-CDAA9F3214C8};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids> <OutputType>WinExe</OutputType> <StartupObject> </StartupObject> <RootNamespace>StateMachineWorkflow</RootNamespace> <AssemblyName>StateMachineWorkflow</AssemblyName> </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>StateMachineWorkflow.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>StateMachineWorkflow.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> <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>
<Project DefaultTargets="Build" xmlns="https://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{4D49A8D9-1CEB-4A6D-9B63-C0FED8EFED91}</ProjectGuid> <OutputType>WinExe</OutputType> <RootNamespace>StateMachineWorkflow</RootNamespace> <AssemblyName>StateMachineWorkflow</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.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> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.Targets" /> </Project>
Save the project file in your project's directory.
In Task 2: Create the Simple Order Form Windows Form, you create the host application that is used in the tutorial.
See Also
Concepts
Other Resources
Task 2: Create the Simple Order Form Windows Form
Tutorial: Create a State Machine Workflow
Ordering State Machine
Simple State Machine
Send comments about this topic to Microsoft.