ContextUtil.ActivityId Property

Definition

Gets a GUID representing the activity containing the component.

C#
public static Guid ActivityId { get; }

Property Value

The GUID for an activity if the current context is part of an activity; otherwise, GUID_NULL.

Exceptions

There is no COM+ context available.

Examples

The following code example gets the value of a ActivityId property.

C#
[Synchronization(SynchronizationOption.Required)]
public class ContextUtil_ActivityId : ServicedComponent
{
    public void Example()
    {
        // Display the ActivityID associated with the current COM+ context.
        Console.WriteLine("Activity ID: {0}", ContextUtil.ActivityId);
    }
}

Applies to

Proizvod Verzije
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1