ContextUtil.ApplicationId Property

 

Gets a GUID for the current application.

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

public static Guid ApplicationId { get; }

Property Value

Type: System.Guid

The GUID for the current application.

Exception Condition
COMException

There is no COM+ context available.

PlatformNotSupportedException

The platform is not Windows XP or later.

The following code example demonstrates the use of this property.

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: