# OpcServerBase Members

> Reference: Provides the base class of OpcServer and OpcDiscoveryServer, which maintains the base addresses and the life cycle (see State) of a server.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcServerBase</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.server">Opc.UaFx.Server</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

Inherits members from [OpcApplicationInstance&lt;OpcTransport, OpcServerSecurity&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members).

## Constructors

### OpcServerBase

<span class="api-meta">protected · 3 overloads</span>

| Overload | Description |
|---|---|
| [OpcServerBase(OpcServerType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#opcserverbase-opc-uafx-server-opcservertype)<span class="api-meta">protected</span> | Initializes a new instance of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/) class using the `type` specified. |
| [OpcServerBase(OpcServerType, string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#opcserverbase-opc-uafx-server-opcservertype-system-string)<span class="api-meta">protected</span> | Initializes a new instance of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/) class using the `type` and `address` specified. |
| [OpcServerBase(OpcServerType, Uri)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#opcserverbase-opc-uafx-server-opcservertype-system-uri)<span class="api-meta">protected</span> | Initializes a new instance of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/) class using the `type` and `address` specified. |

#### OpcServerBase(OpcServerType)

<span class="api-meta">protected</span>

Initializes a new instance of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/) class using the `type` specified.

<div class="api-signature" data-lang="csharp">

```csharp
protected OpcServerBase(OpcServerType type)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Sub New(type As OpcServerType)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcServerType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcservertype/) | One of the members defined by the [OpcServerType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcservertype/) enumeration which specifies the type of the server. |

**Exceptions**

| Exception | Condition |
|---|---|
| [LicenseException](https://learn.microsoft.com/dotnet/api/system.componentmodel.licenseexception) | The license is expired. |

#### OpcServerBase(OpcServerType, string)

<span class="api-meta">protected</span>

Initializes a new instance of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/) class using the `type` and `address` specified.

<div class="api-signature" data-lang="csharp">

```csharp
protected OpcServerBase(OpcServerType type, string address)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Sub New(type As OpcServerType, address As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcServerType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcservertype/) | One of the members defined by the [OpcServerType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcservertype/) enumeration which specifies the type of the server. |
| `address` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [string](https://learn.microsoft.com/dotnet/api/system.string) representation of the address of the server which needs to use one of the supported schemes 'opc.tcp' and 'https'. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `address` is equals [Empty](https://learn.microsoft.com/dotnet/api/system.string.empty) or is not an absolute URI using one of the supported schemes 'opc.tcp' and 'https'. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `address` is a null reference (Nothing in Visual Basic). |

#### OpcServerBase(OpcServerType, Uri)

<span class="api-meta">protected</span>

Initializes a new instance of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/) class using the `type` and `address` specified.

<div class="api-signature" data-lang="csharp">

```csharp
protected OpcServerBase(OpcServerType type, Uri address)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Sub New(type As OpcServerType, address As Uri)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcServerType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcservertype/) | One of the members defined by the [OpcServerType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcservertype/) enumeration which specifies the type of the server. |
| `address` | [Uri](https://learn.microsoft.com/dotnet/api/system.uri) | The [Uri](https://learn.microsoft.com/dotnet/api/system.uri) of the address of the server which needs to use one of the supported schemes 'opc.tcp' and 'https'. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `address` does not use one of the supported schemes 'opc.tcp' and 'https'. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `address` is a null reference (Nothing in Visual Basic). |

## Properties

### Address

Gets or sets the (first) base address of the server.

<div class="api-signature" data-lang="csharp">

```csharp
public Uri Address { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property Address As Uri
```

</div>

**Property value**

[Uri](https://learn.microsoft.com/dotnet/api/system.uri)

The first [Uri](https://learn.microsoft.com/dotnet/api/system.uri) used by the server to listen and response to OPC UA requests or a null reference (Nothing in Visual Basic) in case there is no base address defined.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The value is a null reference (Nothing in Visual Basic) or the address format / scheme can not be used as a server address. |

### Addresses

Gets a read-only collection of [Uri](https://learn.microsoft.com/dotnet/api/system.uri) instances representing the base addresses used by the server.

<div class="api-signature" data-lang="csharp">

```csharp
public ReadOnlyCollection<Uri> Addresses { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Addresses As ReadOnlyCollection(Of Uri)
```

</div>

**Property value**

[ReadOnlyCollection](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.readonlycollection-1)&lt;[Uri](https://learn.microsoft.com/dotnet/api/system.uri)&gt;

A [ReadOnlyCollection&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.readonlycollection-1) of [Uri](https://learn.microsoft.com/dotnet/api/system.uri) instances used by the server to listen and response to OPC UA requests.

**Remarks**

To manage the different base addresses used use the [RegisterAddress](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#registeraddress-system-string)/[RegisterAddress](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#registeraddress-system-uri) method to add an additional base address or use the [UnregisterAddress](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#unregisteraddress-system-string)/ [UnregisterAddress](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#unregisteraddress-system-uri) method to remove a base address.

### AuthenticationLimits

<span class="api-meta">since v2.50</span>

Gets the [OpcAuthenticationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcauthenticationlimits/) instance used to maintain the different authentication limits used by the server.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAuthenticationLimits AuthenticationLimits { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property AuthenticationLimits As OpcAuthenticationLimits
```

</div>

**Property value**

[OpcAuthenticationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcauthenticationlimits/)

An instance of the [OpcAuthenticationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcauthenticationlimits/) class used by the application instance to setup and maintain the different authentication limits.

### Binding

Gets the [OpcServerBinding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbinding/) instance used to maintain the different binding options used by the server application.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcServerBinding Binding { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Binding As OpcServerBinding
```

</div>

**Property value**

[OpcServerBinding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbinding/)

An instance of the [OpcServerBinding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbinding/) class used by the [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) to setup and maintain the different binding options.

### Configuration

<span class="api-meta">override</span>

Gets or sets an instance of the [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) class which is used as a low-level representation of the code/file based server application configuration.

<div class="api-signature" data-lang="csharp">

```csharp
public override OpcApplicationConfiguration Configuration { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
<CLSCompliant(False)>
Public Overrides Property Configuration As OpcApplicationConfiguration
```

</div>

**Property value**

[OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/)

An instance of the [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) class configured with the server specific setup to use. An assignment of a null reference (Nothing in Visual Basic) will lead to the creation of a new instance of the [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) class with all defaults typically used by server applications.

**Overrides**

[Configuration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#configuration)

**Remarks**

A file based [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) needs to be loaded manually either using a specific config-section in its App.config (see [LoadServerConfig](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/members#loadserverconfig)) or using a custom file using [LoadServerConfigFile](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/members#loadserverconfigfile). A low-level code based server configuration can be directly performed using an instance of the [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) like the instance provided by this property. In case there is a different instance applied to this property the property will ensure that the [Address](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#address) property will represent the first base address configured in the base addresses of the passed configuration instance.

### Name

Gets or sets the name of the server.

<div class="api-signature" data-lang="csharp">

```csharp
public string Name { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property Name As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The name of the server; by default a name derived from the type of the server. If the server is hosted as a Windows service, the name is used as the name of the service.

### Namespaces

<span class="api-meta">override · since v2.12</span>

Gets a read-only collection of namespaces used by the server.

<div class="api-signature" data-lang="csharp">

```csharp
public override OpcReadOnlyNamespaceCollection Namespaces { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Overrides ReadOnly Property Namespaces As OpcReadOnlyNamespaceCollection
```

</div>

**Property value**

[OpcReadOnlyNamespaceCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynamespacecollection/)

An instance of the [OpcReadOnlyNamespaceCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynamespacecollection/) class with [OpcNamespace](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnamespace/) items for each 'NamespaceUri' used by the server to organize the nodes in its address space.

**Overrides**

[Namespaces](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#namespaces)

**Remarks**

The items in the [OpcReadOnlyNamespaceCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadonlynamespacecollection/) provided are created during the startup of the server.

### State

Gets a value that indicates the current state of the server.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcServerState State { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property State As OpcServerState
```

</div>

**Property value**

[OpcServerState](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/)

One of the members defined by the [OpcServerState](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/) enumeration. Which specifies the current state of the server.

## Methods

### CreateAuthenticationLimits

<span class="api-meta">protected · virtual · since v2.50</span>

Creates a new instance of the [OpcAuthenticationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcauthenticationlimits/) class.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual OpcAuthenticationLimits CreateAuthenticationLimits()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Function CreateAuthenticationLimits() As OpcAuthenticationLimits
```

</div>

**Returns**

[OpcAuthenticationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcauthenticationlimits/)

A new instance of the[OpcAuthenticationLimits](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcauthenticationlimits/) class.

### CreateConfiguration

<span class="api-meta">protected · virtual</span>

Creates the configuration which is used to start the server.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual OpcApplicationConfiguration CreateConfiguration()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
<CLSCompliant(False)>
Protected Overridable Function CreateConfiguration() As OpcApplicationConfiguration
```

</div>

**Returns**

[OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/)

A new instance of the [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) class which copies the settings of the [Configuration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#configuration) without its client configuration and without the configuration of the other type of server (see [OpcServerType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcservertype/)). Settings which are missing are completed using their defaults.

### CreateSecurity

<span class="api-meta">protected · override · since v2.6</span>

Creates a new instance of the [OpcServerSecurity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserversecurity/) class.

<div class="api-signature" data-lang="csharp">

```csharp
protected override sealed OpcServerSecurity CreateSecurity()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected NotOverridable Overrides Function CreateSecurity() As OpcServerSecurity
```

</div>

**Returns**

[OpcServerSecurity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserversecurity/)

A new instance of the[OpcServerSecurity](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserversecurity/) class.

**Overrides**

[CreateSecurity()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#createsecurity)

### CreateTransport

<span class="api-meta">protected · override · since v2.6</span>

Creates a new instance of the [OpcTransport](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctransport/) class.

<div class="api-signature" data-lang="csharp">

```csharp
protected override sealed OpcTransport CreateTransport()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected NotOverridable Overrides Function CreateTransport() As OpcTransport
```

</div>

**Returns**

[OpcTransport](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctransport/)

A new instance of the[OpcTransport](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctransport/) class.

**Overrides**

[CreateTransport()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#createtransport)

### DenyIfNotStarted

<span class="api-meta">protected</span>

Verifies whether the server is in started state.

<div class="api-signature" data-lang="csharp">

```csharp
protected void DenyIfNotStarted()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Sub DenyIfNotStarted()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) is not equals [Started](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#started). |

### Dispose

<span class="api-meta">protected · override</span>

Releases the unmanaged resources used by the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/) and optionally releases the managed resources.

<div class="api-signature" data-lang="csharp">

```csharp
protected override void Dispose(bool disposing)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overrides Sub Dispose(disposing As Boolean)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `disposing` | [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) | The value true to release both managed and unmanaged resources; otherwise the value false to release only unmanaged resources. |

**Overrides**

[Dispose(bool)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#dispose-system-boolean)

### GetInfo

Gets the information about the product of the server.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcServerInfo GetInfo()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function GetInfo() As OpcServerInfo
```

</div>

**Returns**

[OpcServerInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverinfo/)

The [OpcServerInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverinfo/) provided by [GetInfoCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#getinfocore), which is kept for further calls; if [GetInfoCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#getinfocore) provides none, the information about the current process.

### GetInfoCore

<span class="api-meta">protected · virtual</span>

Provides the information about the product of the server.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual OpcServerInfo GetInfoCore()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Function GetInfoCore() As OpcServerInfo
```

</div>

**Returns**

[OpcServerInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverinfo/)

An [OpcServerInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverinfo/) created from the entry assembly or, if there is none, from the current process. If the [ApplicationName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#applicationname) is set, it is used as the product name.

### OnStarted

<span class="api-meta">protected · virtual</span>

Raises the [Started](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#started) event of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnStarted(EventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnStarted(e As EventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [EventArgs](https://learn.microsoft.com/dotnet/api/system.eventargs) | The event data. |

### OnStarting

<span class="api-meta">protected · virtual</span>

Raises the [Starting](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#starting) event of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnStarting(EventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnStarting(e As EventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [EventArgs](https://learn.microsoft.com/dotnet/api/system.eventargs) | The event data. |

### OnStateChanged

<span class="api-meta">protected · virtual</span>

Raises the [StateChanged](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#statechanged) event of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnStateChanged(OpcServerStateChangedEventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnStateChanged(e As OpcServerStateChangedEventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [OpcServerStateChangedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstatechangedeventargs/) | The event data. |

### OnStopped

<span class="api-meta">protected · virtual</span>

Raises the [Stopped](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#stopped) event of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnStopped(EventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnStopped(e As EventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [EventArgs](https://learn.microsoft.com/dotnet/api/system.eventargs) | The event data. |

### OnStopping

<span class="api-meta">protected · virtual</span>

Raises the [Stopping](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#stopping) event of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnStopping(EventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnStopping(e As EventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [EventArgs](https://learn.microsoft.com/dotnet/api/system.eventargs) | The event data. |

### OnSuspended

<span class="api-meta">protected · virtual · since v2.50</span>

Raises the [Suspended](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#suspended) event of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnSuspended(EventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnSuspended(e As EventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [EventArgs](https://learn.microsoft.com/dotnet/api/system.eventargs) | The event data. |

### OnSuspending

<span class="api-meta">protected · virtual · since v2.50</span>

Raises the [Suspending](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#suspending) event of the [OpcServerBase](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnSuspending(EventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnSuspending(e As EventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [EventArgs](https://learn.microsoft.com/dotnet/api/system.eventargs) | The event data. |

### RegisterAddress

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [RegisterAddress(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#registeraddress-system-string) | Registers the `address` specified as one of the base addresses used by the server. |
| [RegisterAddress(Uri)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#registeraddress-system-uri) | Registers the `address` specified as one of the base addresses used by the server. |

#### RegisterAddress(string)

Registers the `address` specified as one of the base addresses used by the server.

<div class="api-signature" data-lang="csharp">

```csharp
public void RegisterAddress(string address)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub RegisterAddress(address As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `address` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The uniform resource identifier which defines the communication schema, the host, the port and optionally the path to listen to. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `address` is a null reference (Nothing in Visual Basic). |
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `address` is an empty string, is not an absolute URI or the address format / scheme can not be used as a server address. |

**Remarks**

In case there the `address` is already in use as a base address, it will not be added to the list of base addresses a second time. In case there the [Address](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#address) properties is a null reference (Nothing in Visual Basic), the `address` will be used.

#### RegisterAddress(Uri)

Registers the `address` specified as one of the base addresses used by the server.

<div class="api-signature" data-lang="csharp">

```csharp
public void RegisterAddress(Uri address)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub RegisterAddress(address As Uri)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `address` | [Uri](https://learn.microsoft.com/dotnet/api/system.uri) | The [Uri](https://learn.microsoft.com/dotnet/api/system.uri) which defines the communication schema, the host, the port and optionally the path to listen to. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `address` is a null reference (Nothing in Visual Basic) or the address format / scheme can not be used as a server address. |

**Remarks**

In case there the `address` is already in use as a base address, it will not be added to the list of base addresses a second time. In case there the [Address](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#address) properties is a null reference (Nothing in Visual Basic), the `address` will be used.

### Resume

<span class="api-meta">since v2.11</span>

Resumes the suspended server.

<div class="api-signature" data-lang="csharp">

```csharp
public void Resume()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub [Resume]()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [LicenseException](https://learn.microsoft.com/dotnet/api/system.componentmodel.licenseexception) | The license is expired. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The server does not support to be resumed (see [ResumeCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#resumecore)). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The server could not be resumed; for more details see exception details. |
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |

**Remarks**

The method resumes the server only in the state [Suspended](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#suspended); in any other state it returns at once. While the server is being resumed, the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) is [Starting](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#starting). If resuming fails, the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) is reset to [Suspended](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#suspended), which raises the [StateChanged](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#statechanged) and [Suspended](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#suspended) events again.

### ResumeCore

<span class="api-meta">protected · virtual · since v2.11</span>

When overridden in a derived class, resumes the suspended server.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void ResumeCore()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub ResumeCore()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | Always thrown by the base implementation. |

**Remarks**

The method is called by [Resume](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#resume).

### Setup

<span class="api-meta">protected · override · since v2.6</span>

Sets up the `configuration` specified before the server is started.

<div class="api-signature" data-lang="csharp">

```csharp
protected override void Setup(OpcApplicationConfiguration configuration)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
<CLSCompliant(False)>
Protected Overrides Sub Setup(configuration As OpcApplicationConfiguration)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `configuration` | [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) | The [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) created by [CreateConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#createconfiguration). |

**Overrides**

[Setup(OpcApplicationConfiguration)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationinstance-2/members#setup)

**Remarks**

The base addresses of the `configuration` start with the [Addresses](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#addresses) of the server, followed by the further base addresses of the `configuration`.

### Start

Starts the server.

<div class="api-signature" data-lang="csharp">

```csharp
public void Start()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Start()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The server has no base address (see [Addresses](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#addresses)). |
| [LicenseException](https://learn.microsoft.com/dotnet/api/system.componentmodel.licenseexception) | The license is expired. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The configuration is invalid or the server could not be started; for more details see exception details. |
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |

**Remarks**

The method starts the server only in the state [Created](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#created) or [Stopped](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#stopped); in any other state it returns at once. While the server is being started, the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) is [Starting](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#starting). If starting fails, the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) is reset to the state before, which raises the [StateChanged](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#statechanged) event and, from the state [Stopped](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#stopped), the [Stopped](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#stopped) event again.

### StartCore

<span class="api-meta">protected · virtual</span>

When overridden in a derived class, starts the server using the `configuration` specified.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void StartCore(OpcApplicationConfiguration configuration)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
<CLSCompliant(False)>
Protected Overridable Sub StartCore(
    configuration As OpcApplicationConfiguration)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `configuration` | [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) | The [OpcApplicationConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplicationconfiguration/) created by [CreateConfiguration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#createconfiguration) and set up by [Setup](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#setup). |

**Remarks**

The method is called by [Start](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#start). The base implementation does nothing.

### Stop

Stops the server.

<div class="api-signature" data-lang="csharp">

```csharp
public void Stop()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub [Stop]()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [LicenseException](https://learn.microsoft.com/dotnet/api/system.componentmodel.licenseexception) | The license is expired. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The server could not be stopped; for more details see exception details. |
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |

**Remarks**

The method stops the server only in the state [Started](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#started) or [Suspended](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#suspended); in any other state it returns at once. While the server is being stopped, the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) is [Stopping](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#stopping). If stopping fails, the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) is reset to the state before, which raises the [StateChanged](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#statechanged) event and the event of that state again.

### StopCore

<span class="api-meta">protected · abstract</span>

When implemented in a derived class, stops the server.

<div class="api-signature" data-lang="csharp">

```csharp
protected abstract void StopCore()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected MustOverride Sub StopCore()
```

</div>

**Remarks**

The method is called by [Stop](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#stop).

### Suspend

<span class="api-meta">since v2.11</span>

Suspends the started server.

<div class="api-signature" data-lang="csharp">

```csharp
public void Suspend()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Suspend()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [LicenseException](https://learn.microsoft.com/dotnet/api/system.componentmodel.licenseexception) | The license is expired. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The server does not support to be suspended (see [SuspendCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#suspendcore)). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The server could not be suspended; for more details see exception details. |
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |

**Remarks**

The method suspends the server only in the state [Started](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#started); in any other state it returns at once. While the server is being suspended, the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) is [Suspending](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#suspending). If suspending fails, the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) is reset to [Started](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#started), which raises the [StateChanged](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#statechanged) and [Started](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#started) events again.

### SuspendCore

<span class="api-meta">protected · virtual · since v2.11</span>

When overridden in a derived class, suspends the started server.

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void SuspendCore()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub SuspendCore()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | Always thrown by the base implementation. |

**Remarks**

The method is called by [Suspend](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#suspend).

### UnregisterAddress

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [UnregisterAddress(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#unregisteraddress-system-string) | Unregisters the `address` specified from the list of base addresses used by the server. |
| [UnregisterAddress(Uri)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#unregisteraddress-system-uri) | Unregisters the `address` specified from the list of base addresses used by the server. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `address` is a null reference (Nothing in Visual Basic). |

#### UnregisterAddress(string)

Unregisters the `address` specified from the list of base addresses used by the server.

<div class="api-signature" data-lang="csharp">

```csharp
public void UnregisterAddress(string address)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub UnregisterAddress(address As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `address` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The uniform resource identifier which defines the communication schema, the host, the port and optionally the path to remove. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `address` is an empty string. |
| [FormatException](https://learn.microsoft.com/dotnet/api/system.formatexception) | The `address` is not a valid URI format. |

**Remarks**

In case there `address` is equals to [Address](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#address) the [Address](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#address) property will be set to a null reference (Nothing in Visual Basic) if there is no other address registered; otherwise the first entry in [Addresses](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#addresses) will be used for [Address](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#address).

#### UnregisterAddress(Uri)

Unregisters the `address` specified from the list of base addresses used by the server.

<div class="api-signature" data-lang="csharp">

```csharp
public void UnregisterAddress(Uri address)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub UnregisterAddress(address As Uri)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `address` | [Uri](https://learn.microsoft.com/dotnet/api/system.uri) | The [Uri](https://learn.microsoft.com/dotnet/api/system.uri) which defines the communication schema, the host, the port and optionally the path to remove. |

**Remarks**

In case there `address` is equals to [Address](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#address) the [Address](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#address) property will be set to a null reference (Nothing in Visual Basic) if there is no other address registered; otherwise the first entry in [Addresses](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#addresses) will be used for [Address](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#address).

## Events

### Started

Occurs when the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) of the server changes to [Started](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#started).

<div class="api-signature" data-lang="csharp">

```csharp
public event EventHandler Started
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event Started As EventHandler
```

</div>

**Event type**

[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler)

### Starting

Occurs when the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) of the server changes to [Starting](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#starting).

<div class="api-signature" data-lang="csharp">

```csharp
public event EventHandler Starting
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event Starting As EventHandler
```

</div>

**Event type**

[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler)

### StateChanged

Occurs when ever the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) property has been changed to a different value.

<div class="api-signature" data-lang="csharp">

```csharp
public event EventHandler<OpcServerStateChangedEventArgs> StateChanged
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event StateChanged As EventHandler(Of OpcServerStateChangedEventArgs)
```

</div>

**Event type**

[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler-1)&lt;[OpcServerStateChangedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstatechangedeventargs/)&gt;

### Stopped

Occurs when the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) of the server changes to [Stopped](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#stopped).

<div class="api-signature" data-lang="csharp">

```csharp
public event EventHandler Stopped
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event Stopped As EventHandler
```

</div>

**Event type**

[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler)

### Stopping

Occurs when the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) of the server changes to [Stopping](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#stopping).

<div class="api-signature" data-lang="csharp">

```csharp
public event EventHandler Stopping
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event Stopping As EventHandler
```

</div>

**Event type**

[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler)

### Suspended

<span class="api-meta">since v2.50</span>

Occurs when the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) of the server changes to [Suspended](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#suspended).

<div class="api-signature" data-lang="csharp">

```csharp
public event EventHandler Suspended
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event Suspended As EventHandler
```

</div>

**Event type**

[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler)

### Suspending

<span class="api-meta">since v2.50</span>

Occurs when the [State](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverbase/members#state) of the server changes to [Suspending](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverstate/#suspending).

<div class="api-signature" data-lang="csharp">

```csharp
public event EventHandler Suspending
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event Suspending As EventHandler
```

</div>

**Event type**

[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler)
