# OpcServerApplication Members

> Reference: Represents an application which hosts an OpcServer and starts it when the application is run.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcServerApplication</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 [OpcServerApplication&lt;OpcServer&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members), [OpcApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplication/members).

## Constructors

### OpcServerApplication

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

| Overload | Description |
|---|---|
| [OpcServerApplication(OpcServer)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/members#opcserverapplication-opc-uafx-server-opcserver) | Initializes a new instance of the [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/) class using the `server` specified. |
| [OpcServerApplication(string, IEnumerable&lt;OpcNodeManager&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/members#opcserverapplication-system-string-system-collections-generic-ienumerable-of-opc-uafx-server-opcnodemanager) | Initializes a new instance of the [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/) class which hosts a new [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) using the `address` and `nodeManagers` specified. |
| [OpcServerApplication(Uri, IEnumerable&lt;OpcNodeManager&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/members#opcserverapplication-system-uri-system-collections-generic-ienumerable-of-opc-uafx-server-opcnodemanager) | Initializes a new instance of the [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/) class which hosts a new [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) using the `address` and `nodeManagers` specified. |
| [OpcServerApplication(string, params OpcNodeManager\[\])](#opcserverapplication-system-string-opc-uafx-server-opcnodemanager-array) | Initializes a new instance of the [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/) class which hosts a new [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) using the `address` and `nodeManagers` specified. |
| [OpcServerApplication(Uri, params OpcNodeManager\[\])](#opcserverapplication-system-uri-opc-uafx-server-opcnodemanager-array) | Initializes a new instance of the [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/) class which hosts a new [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) using the `address` and `nodeManagers` specified. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | An application has already been created on the current thread and has not yet been exited (see [Current](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplication/members#current)). |

#### OpcServerApplication(OpcServer)

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

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

```csharp
public OpcServerApplication(OpcServer server)
```

</div>

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

```vbnet
Public Sub New(server As OpcServer)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `server` | [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) | The [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) to host. |

**Exceptions**

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

#### OpcServerApplication(string, IEnumerable&lt;OpcNodeManager&gt;)

Initializes a new instance of the [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/) class which hosts a new [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) using the `address` and `nodeManagers` specified.

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

```csharp
public OpcServerApplication(
    string address,
    IEnumerable<OpcNodeManager> nodeManagers)
```

</div>

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

```vbnet
Public Sub New(
    address As String,
    nodeManagers As IEnumerable(Of OpcNodeManager))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `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'. |
| `nodeManagers` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/)&gt; | A sequence of [OpcNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/) instances which provide the address space of the server. The first node manager is used as the [DefaultNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#defaultnodemanager). |

**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` or `nodeManagers` sequence or one of its items is a null reference (Nothing in Visual Basic). |

#### OpcServerApplication(Uri, IEnumerable&lt;OpcNodeManager&gt;)

Initializes a new instance of the [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/) class which hosts a new [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) using the `address` and `nodeManagers` specified.

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

```csharp
public OpcServerApplication(
    Uri address,
    IEnumerable<OpcNodeManager> nodeManagers)
```

</div>

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

```vbnet
Public Sub New(address As Uri, nodeManagers As IEnumerable(Of OpcNodeManager))
```

</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) of the address of the server which needs to use one of the supported schemes 'opc.tcp' and 'https'. |
| `nodeManagers` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/)&gt; | A sequence of [OpcNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/) instances which provide the address space of the server. The first node manager is used as the [DefaultNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#defaultnodemanager). |

**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` or `nodeManagers` sequence or one of its items is a null reference (Nothing in Visual Basic). |

#### OpcServerApplication(string, params OpcNodeManager\[\])

Initializes a new instance of the [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/) class which hosts a new [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) using the `address` and `nodeManagers` specified.

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

```csharp
public OpcServerApplication(
    string address,
    params OpcNodeManager[] nodeManagers)
```

</div>

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

```vbnet
Public Sub New(address As String, ParamArray nodeManagers As OpcNodeManager())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `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'. |
| `nodeManagers` | params [OpcNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/)[] | An array of [OpcNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/) instances which provide the address space of the server. The first node manager is used as the [DefaultNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#defaultnodemanager). |

**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` or `nodeManagers` array or one of its items is a null reference (Nothing in Visual Basic). |

#### OpcServerApplication(Uri, params OpcNodeManager\[\])

Initializes a new instance of the [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/) class which hosts a new [OpcServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/) using the `address` and `nodeManagers` specified.

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

```csharp
public OpcServerApplication(Uri address, params OpcNodeManager[] nodeManagers)
```

</div>

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

```vbnet
Public Sub New(address As Uri, ParamArray nodeManagers As OpcNodeManager())
```

</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) of the address of the server which needs to use one of the supported schemes 'opc.tcp' and 'https'. |
| `nodeManagers` | params [OpcNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/)[] | An array of [OpcNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcnodemanager/) instances which provide the address space of the server. The first node manager is used as the [DefaultNodeManager](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserver/members#defaultnodemanager). |

**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` or `nodeManagers` array or one of its items is a null reference (Nothing in Visual Basic). |
