ContextUtil.ContextId 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 for the current context.

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

public static Guid ContextId { get; }

Property Value

Type: System.Guid

The GUID for the current context.

Exception Condition
COMException

There is no COM+ context available.

PlatformNotSupportedException

The platform is not Windows 2000 or later.

The following example code demonstrates the use of this attribute.

protected override void Activate()
{
    MessageBox.Show( String.Format("Now entering...\nApplication: {0}\nInstance: {1}\nContext: {2}\n",
                                   ContextUtil.ApplicationId.ToString(), ContextUtil.ApplicationInstanceId.ToString(),
                                   ContextUtil.ContextId.ToString() ) );
}

.NET Framework
Available since 1.1
Return to top
Show: