This topic has not yet been rated - Rate this topic

TrackingWorkflowExceptionEventArgs.Exception Property

Gets the Exception that is being thrown by the workflow instance.

Namespace:  System.Workflow.Runtime.Tracking
Assembly:  System.Workflow.Runtime (in System.Workflow.Runtime.dll)
public Exception Exception { get; }

Property Value

Type: System.Exception
The exception that is being thrown by the workflow instance.

The following code example demonstrates a method, named WriteExceptionEventArgs, which captures a TrackingWorkflowExceptionEventArgs. The code checks whether the Exception property is null (Nothing in Visual Basic). If it is not, the code writes the message associated with the Exception property to the console. If Exception is null (Nothing), the code converts the value of the OriginalActivityPath property to a string and writes it to the console.

This code example is part of the EventArgs Tracking SDK Sample from the Program.cs file. For more information, see EventArgs Tracking Sample.

static void WriteExceptionEventArgs(string eventDescription, TrackingWorkflowExceptionEventArgs exceptionEventArgs, DateTime eventDataTime)
{
    Console.WriteLine("\nException Event Arguments Read From Tracking Database:\n");
    Console.WriteLine("EventDataTime: " + eventDataTime.ToString());
    Console.WriteLine("EventDescription: " + eventDescription);
    if (null != exceptionEventArgs.Exception)
    {
        Console.WriteLine("ExceptionEventArgs Exception Message: " + exceptionEventArgs.Exception.Message.ToString());
    }
    Console.WriteLine("ExceptionEventArgs Original Activity Path: " + exceptionEventArgs.OriginalActivityPath.ToString());
}

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.