# OpcServerApplication&lt;T&gt; Class

> Reference: Provides a base class for applications which host a server of the type T and start it when the application is run.

<dl class="api-definition">
<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>
<dt>Members</dt>
<dd><a href="./members">OpcServerApplication&lt;T&gt; Members</a></dd>
</dl>

Provides a base class for applications which host a server of the type `T` and start it when the application is run.

## Syntax

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

```csharp
public class OpcServerApplication<T> : OpcApplication
    where T : OpcServerBase, new()
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Class OpcServerApplication(Of T As {OpcServerBase, New})
    Inherits OpcApplication
```

</div>

## Type parameters

| Name | Description |
|---|---|
| `T` | The type of the server to host. |

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → [OpcApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplication/) → **OpcServerApplication&lt;T&gt;**

## Implements

<ul class="api-implements">
<li><a href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></li>
<li><a href="../opc.uafx.iopcapplication/">IOpcApplication</a></li>
</ul>

## Derived types

- [OpcDiscoveryServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdiscoveryserverapplication/)
- [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication/)

## Constructors

| Name | Description |
|---|---|
| [OpcServerApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members#opcserverapplication)<span class="api-meta">2 overloads</span> | Initializes a new instance of the OpcServerApplication&lt;T&gt; class which hosts a new instance of the type `T`. |

## Properties

| Name | Description |
|---|---|
| [Configuration](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members#configuration)<span class="api-meta">override</span> | Gets the configuration of the [Server](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members#server). |
| [Server](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members#server) | Gets the server hosted by the application. |

## Methods

| Name | Description |
|---|---|
| [ExitCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members#exitcore)<span class="api-meta">protected · override</span> | Stops the [Server](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members#server) and raises the [Exiting](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplication/members#exiting) and [Exited](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplication/members#exited) events. |
| [LoadConfigurationCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members#loadconfigurationcore)<span class="api-meta">protected · override</span> | Loads the server configuration from the configuration section with the `configSectionName` specified and assigns it to the [Server](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members#server). |
| [RunCore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members#runcore)<span class="api-meta">protected · override</span> | Starts the [Server](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcserverapplication-1/members#server) and waits until the application exits. |

Inherits members from [OpcApplication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcapplication/members).

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.5–v2.59 |
