# OpcClientApplication Members

> Reference: Represents an application which hosts an OpcClient and connects it to the server when the application is run.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcClientApplication</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.client">Opc.UaFx.Client</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Inherits members from [OpcClientApplication&lt;OpcClient&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientapplication-1/members), [OpcApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplication/members).

## Constructors

### OpcClientApplication

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

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

#### OpcClientApplication(OpcClient)

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

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

```csharp
public OpcClientApplication(OpcClient client)
```

</div>

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

```vbnet
Public Sub New(client As OpcClient)
```

</div>

**Parameters**

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

**Exceptions**

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

#### OpcClientApplication(string)

Initializes a new instance of the [OpcClientApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientapplication/) class which hosts a new [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) using the `serverUri` specified.

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

```csharp
public OpcClientApplication(string serverUri)
```

</div>

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

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

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `serverUri` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The URI of the OPC UA server to operate on. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `serverUri` is an empty string. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `serverUri` is a null reference (Nothing in Visual Basic). |
| [UriFormatException](https://learn.microsoft.com/dotnet/api/system.uriformatexception) | The `serverUri` is not a valid URI. |

#### OpcClientApplication(Uri)

Initializes a new instance of the [OpcClientApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclientapplication/) class which hosts a new [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) using the `serverUri` specified.

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

```csharp
public OpcClientApplication(Uri serverUri)
```

</div>

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

```vbnet
Public Sub New(serverUri As Uri)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `serverUri` | [Uri](https://learn.microsoft.com/dotnet/api/system.uri) | The [Uri](https://learn.microsoft.com/dotnet/api/system.uri) of the OPC UA server to operate on. |

**Exceptions**

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