ContextId Property

ContextUtil.ContextId Property


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

There is no COM+ context available.


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
© 2015 Microsoft