ContextUtil::ActivityId Property

 

Gets a GUID representing the activity containing the component.

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

public:
property Guid ActivityId {
	static Guid 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 ref class ContextUtil_ActivityId: public 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: