# OpcDiscoveryServerApplication Members

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

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcDiscoveryServerApplication</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;OpcDiscoveryServer&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

### OpcDiscoveryServerApplication

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

| Overload | Description |
|---|---|
| [OpcDiscoveryServerApplication(OpcDiscoveryServer)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserverapplication/members#opcdiscoveryserverapplication-opc-uafx-server-opcdiscoveryserver) | Initializes a new instance of the [OpcDiscoveryServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserverapplication/) class using the `server` specified. |
| [OpcDiscoveryServerApplication(string)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserverapplication/members#opcdiscoveryserverapplication-system-string) | Initializes a new instance of the [OpcDiscoveryServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserverapplication/) class which hosts a new [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) using the `address` specified. |
| [OpcDiscoveryServerApplication(Uri)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserverapplication/members#opcdiscoveryserverapplication-system-uri) | Initializes a new instance of the [OpcDiscoveryServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserverapplication/) class which hosts a new [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) using the `address` 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)). |

#### OpcDiscoveryServerApplication(OpcDiscoveryServer)

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

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

```csharp
public OpcDiscoveryServerApplication(OpcDiscoveryServer server)
```

</div>

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

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

</div>

**Parameters**

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

**Exceptions**

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

#### OpcDiscoveryServerApplication(string)

Initializes a new instance of the [OpcDiscoveryServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserverapplication/) class which hosts a new [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) using the `address` specified.

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

```csharp
public OpcDiscoveryServerApplication(string address)
```

</div>

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

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

</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 discovery 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). |

#### OpcDiscoveryServerApplication(Uri)

Initializes a new instance of the [OpcDiscoveryServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserverapplication/) class which hosts a new [OpcDiscoveryServer](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserver/) using the `address` specified.

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

```csharp
public OpcDiscoveryServerApplication(Uri address)
```

</div>

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

```vbnet
Public Sub New(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) of the address of the discovery 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). |
