Debugging SharePoint Workflow Solutions

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Applies to

The information in this topic applies only to the specified Visual Studio projects and versions of Microsoft Office.

Project type

  • SharePoint workflow

Microsoft Office version

  • SharePoint Server 2007

The SharePoint templates display only in projects that target .NET Framework 3.5 or earlier versions of the .NET Framework. For more information, see Features Available by Office Application and Project Type.

You can debug a SharePoint workflow template by using the Visual Studio debugger. When you start debugging, Visual Studio opens a SharePoint site and adds the workflow template to a library or list. You can then start an instance of the workflow template and use standard debugging tools to debug your code.

Note

If you add references to other assemblies, ensure that those assemblies are installed in the global assembly cache. Otherwise, the workflow solution will fail. For information about how to install assemblies, see How to: Install an Assembly into the Global Assembly Cache.

Specifying Debug Configuration Settings

You can specify debug configuration settings in the New Office SharePoint Workflow wizard when you first create a SharePoint 2007 Sequential Workflow or SharePoint 2007 State Machine Workflow project. For more information, see How to: Create a SharePoint Workflow Project.

You can change these settings in the Properties window or by starting the New Office SharePoint Workflow wizard again. For more information, see How to: Modify the Debug Configuration Settings of a SharePoint Workflow Project.

The following table shows the debug settings that are included in the wizard.

Setting

Description

Display Name

Identifies the workflow template on the SharePoint Server Web site. This name appears in a list of workflow templates that are available for a library or list.

Target Site

Specifies the URL of the SharePoint Web site that you want to use to run this workflow. To develop and debug this workflow, this site must be on the local computer.

Target List

Specifies the library or list that you will use to initiate the workflow. The activities in the workflow apply to items in this library or list.

Task List

Specifies the task list that you want to use. The task list displays the workflow tasks that are available to each workflow participant.

History List

Specifies the list that displays all the events that occur as the workflow is running. If a history list does not exist on the local SharePoint Web site, then the Visual Studio workflow deployment process creates one.

Auto Associate

Indicates whether to automatically associate the workflow template with the library or list that you specify in the New Office SharePoint Workflow wizard.

If you select this option, the Visual Studio workflow deployment process associates the workflow template with the specified library or list.

If you clear this option, you must associate the workflow template with the library or list manually by using the Add a Workflow administration page in the SharePoint Web site.

Allow Manual Start

Indicates whether you can manually start the workflow from a document in the library or an item in the list. For more information, see Manually start a workflow on a document item.

Start at Item Creation

Indicates whether to start the workflow when a new item is created in the library or list.

Start at Item Change

Indicates whether to start the workflow when an item is updated in the library or list.

SharePoint Features

A feature is a portable and modular unit of functionality that simplifies modification of sites through site definitions. A feature is a package of Windows SharePoint Services elements that can be activated for a specific scope and that helps users accomplish a particular goal or task. The workflow deployment process deploys workflow templates as features.

When you start the debugger, the workflow deployment process creates a folder in the feature directory at %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES.

The solution's folder in the feature directory contains a feature definition file and a workflow definition file. The feature definition file (feature.xml) describes the files in the workflow feature.The workflow definition file (workflow.xml) describes the workflow template. You can find these files in Solution Explorer. For more information about these files, see SharePoint Workflow Project Templates.

Debug Deployment Process

When you start the Visual Studio debugger, the Visual Studio workflow deployment process performs the following tasks:

  • Deploys the feature and workflow definition files to SharePoint Server.

  • Installs the workflow assembly in the global assembly cache (GAC).

  • Restarts Internet Information Services (IIS) and SharePoint Server.

  • Activates the feature in SharePoint Server 2007.

  • Associates the workflow with the SharePoint library or list that you selected in the New Office SharePoint Workflow wizard.

  • Attaches the Visual Studio debugger to the Windows SharePoint Services process (w3wp.exe).

  • Displays the appropriate library or list page.

    Note

    If you chose not to automatically associate the workflow template with the library or list, then you must first associate the workflow template with the library or list manually by using the Add a Workflow administration page in SharePoint.

Visual Studio displays a status message in the Visual Studio Output window after each task is completed. If a task cannot be completed, Visual Studio displays an error message in the Visual Studio Error List window. For information about how to resolve errors, see Troubleshooting SharePoint Workflow Solutions.

Starting the Workflow

The deployment process does not start the workflow. You must start the workflow from the SharePoint Web site. You can also start the workflow by using a client application such as Microsoft Office Word 2007, or by using separate server-side code. Use one of the approaches that you specified in the New SharePoint Workflow wizard.

For example, if you specified that the workflow can be started manually, start the workflow directly from the item in the library or list. For more information about how to start a workflow manually, see Manually start a workflow on a document item.

See Also

Tasks

How to: Include Helper Files When you Debug a SharePoint Solution

Walkthrough: Creating and Debugging a SharePoint Workflow Solution

Concepts

Troubleshooting SharePoint Workflow Solutions

Other Resources

Office Development Samples and Walkthroughs

SharePoint Workflow Solutions

Workflow deployment using features