ContextUtil.ActivityId Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets a GUID representing the activity containing the component.

Namespace:   System.EnterpriseServices
Assembly:  System.EnterpriseServices (in System.EnterpriseServices.dll)

public static Guid ActivityId { get; }

Property Value

Type: System.Guid

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

Exception Condition

There is no COM+ context available.


The platform is not Windows 2000 or later.

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

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

.NET Framework
Available since 1.1
Return to top