다음을 통해 공유


How to: Manually Configure a Workflow Project

Applies to: SharePoint Foundation 2010

This topic explains how to manually configure a workflow project without using the templates provided by Visual Studio.

To develop a custom Microsoft SharePoint Foundation 2010 workflow in the Visual Studio 2010 Workflow Designer, you must add two references to your workflow project:

  • A reference to the Microsoft.SharePoint.dll to enable access to the SharePoint Foundation 2010 object model in your code.

  • A reference to the Microsoft.SharePoint.WorkflowActions.dll to enable access to predefined SharePoint Foundation activities. In addition, you must place those activities in the Toolbox.

For more information about the Windows Workflow Foundation, including using the Visual Studio 2010 Workflow Designer to create workflow solutions, visit the Windows Workflow Foundation Developer Center.

To add the necessary references to the workflow project

  1. In Solution Explorer, right-click References, and then select Add Reference.

  2. On the Browse tab, navigate to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\isapi.

  3. Select Microsoft.SharePoint.dll and Microsoft.SharePoint.WorkflowActions.dll.

  4. Click OK.

To add workflow activities for SharePoint Foundation to the Toolbox

  1. Right-click the Visual Studio Toolbox pane, and then click Choose Items.

  2. Click the Activities tab, and then click Browse. Browse to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\.

  3. Select the Microsoft.SharePoint.WorkflowActions.dll.

  4. Click OK.

In the Toolbox pane, you should now see activities specific to workflows in SharePoint Foundation 2010, such as OnWorkflowActivated and SendEmail.

Note

You can also get the SharePoint Foundation 2010 workflow activities to appear in your Toolbox pane if you edit your workflow project so that the workflow derives from the SharePointSequentialWorkflowActivity class, rather than the default SequentialWorkflowActivity class. In your workflow code, change the following line of code:

public sealed partial class Workflow1: SequentialWorkflowActivity

To read:

public sealed partial class Workflow1: SharePointSequentialWorkflowActivity

See Also

Concepts

Workflow Development for SharePoint Foundation

Workflow Activities for SharePoint Foundation

Workflow Forms Overview