ContextUtil.ActivityId Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com 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
COMException

There is no COM+ context available.

PlatformNotSupportedException

The platform is not Windows 2000 or later.

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

[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);
    }
}

.NET Framework
Available since 1.1
Return to top
Show: