ContextUtil::ContextId Property

 

Gets a GUID for the current context.

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

public:
property Guid ContextId {
	static Guid 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:
   virtual void Activate() override
   {
      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: