OPC Studio User's Guide and Reference
SharedInstance Property (EasyUAServerManagement)



OpcLabs.ServerOpcUAComponents Assembly > OpcLabs.EasyOpc.UA Namespace > EasyUAServerManagement Class : SharedInstance Property
A shared instance of the server object.
Syntax
'Declaration
 
<NotNullAttribute()>
Public Property SharedInstance As EasyUAServer
'Usage
 
Dim instance As EasyUAServerManagement
Dim value As EasyUAServer
 
instance.SharedInstance = value
 
value = instance.SharedInstance
[NotNull()]
public EasyUAServer SharedInstance {get; set;}
[NotNull()]
public:
property EasyUAServer^ SharedInstance {
   EasyUAServer^ get();
   void set (    EasyUAServer^ value);
}

Property Value

The value of this property cannot be null (Nothing in Visual Basic).

Exceptions
ExceptionDescription

One of the arguments provided to a method is not valid.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

Remarks

Use this property with care, as its usability is limited. Its main use is for testing, and for non-library application code where just a single instance is sufficient.

We also do not recommend using the shared instance for library code, due to conflicts that may arise if your library sets some instance parameters which may not be the same as what other libraries or the final application expects.

This method or property does not throw any exceptions, aside from execution exceptions such as System.Threading.ThreadAbortException or System.OutOfMemoryException.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also