This documentation is archived and is not being maintained.

SuspendActivity.Error Property

Gets or sets an error message to report to administrators providing the reason for suspension.

Namespace:  System.Workflow.ComponentModel
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

public string Error { get; set; }

Property Value

Type: System.String
An error message that provides the reason for the workflow instance suspension. The default value is null.

Propagation of this error message is determined by the host (the instance manager or the persistence provider).

This example illustrates initializing the Error property of a SuspendActivity, and other concepts discussed elsewhere in this type.

This code example is part of the Suspend and Terminate SDK sample and is from the SuspendAndTerminateWorkflow.Designer.cs file. For more information, see Using Suspend and Terminate.

private void InitializeComponent()
    this.CanModifyActivities = true;
    this.suspend = new System.Workflow.ComponentModel.SuspendActivity();
    this.consoleMessage = new System.Workflow.Activities.CodeActivity();
    this.terminate = new System.Workflow.ComponentModel.TerminateActivity();
    // suspend 
    this.suspend.Error = null;
    this.suspend.Name = "suspend";
    // ConsoleMessage 
    this.consoleMessage.Name = "consoleMessage";
    this.consoleMessage.ExecuteCode += new System.EventHandler(this.OnConsoleMessage);
    // terminate 
    this.terminate.Error = null;
    this.terminate.Name = "terminate";
    // SuspendAndTerminateWorkflow 
    this.Name = "SuspendAndTerminateWorkflow";
    this.CanModifyActivities = false;

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0