Share via


Task 1: Create the Custom Activity 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.

If you are using C#, give the project file a .csproj file name extension. If you are using Visual Basic, give it a .vbproj file name extension. As you progress through the tutorial, you will edit this file to add new project files.

To create the CustomActivity project file

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

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

  2. 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>{CC3CD618-6C96-472C-A6AD-560931A75337}</ProjectGuid>
        <ProjectTypeGuids>{D59BE175-2ED0-4C54-BE3D-CDAA9F3214C8};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
        <OutputType>WinExe</OutputType>
        <StartupObject>
        </StartupObject>
        <RootNamespace>WebTearWorkflow</RootNamespace>
        <AssemblyName>WebTearWorkflow</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>CustomActivity.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>CustomActivity.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>{B33E8034-0FB5-4695-9171-D44E03F59C19}</ProjectGuid>
        <OutputType>WinExe</OutputType>
        <RootNamespace>WebTearWorkflow</RootNamespace>
        <AssemblyName>WebTearWorkflow</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>
    
  3. Save the project file in your project directory.

In the next task, Task 2: Create the Custom Activity Host Application, you will create the host application that is used in this tutorial.

See Also

Other Resources

Task 2: Create the Custom Activity Host Application
Tutorial: Create a Custom Activity
Custom Activities

Footer image

Send comments about this topic to Microsoft.