.NET Library

<< Click to Display Table of Contents >>

Navigation:  Development > Client >

.NET Library

 

DTS provides a fully featured Client library for Microsoft® .NET™ with its dts-client-dotnet package. This section outlines how the library can be used for connecting to DTS and making requests and provides some insight into implementing custom DTS clients.

 

Library package

 

The .NET Client library package is currently only available as a nuget package which includes the base library and references all required dependencies. This means that you can import it into your VS project as is, or you can extract it and include the DLLs manually and resolve the dependencies. For reference, the external dependencies are:

Microsoft.CodeAnalysis.Common (4.2.0)

Microsoft.CodeAnalysis.CSharp (4.2.0)

ServiceStack.Redis (6.1.0)

System.CodeDom (6.0.0)

 

The .NET Client library package is built and tested using the .NET 6.0 Framework.

Information-icon_16px If you require a build in a different .NET Framework, please contact us for a custom build.

 

Environment

 

While your implementation can make use of any environment variables it requires, the following are leveraged by the DTS client libraries.

Variable

Default

Function

DTS_REDIS_HOST_NAME

localhost

The host name or IP address of the DTS Redis server (Internal Communication Bus)

DTS_REDIS_PORT

6379

The port of the Redis server

DTS_CLIENT_NAME

anonymous

A name given to the client that will be used to tag it administrative purposes. This name will be suffixed with "@[hostname]".

DTS_DEBUG_LOGGING

false

Flag to toggle debug logging

DTS_ENABLE_SECURITY

false

Flag to toggle internal security (if the central DTS deployment is secured, clients are also required to be)

DTS_X509_CERTIFICATE_PATH

null

The local path to the X509 certificate file that was generated for this client (see Security Setup)

DTS_RSA_PRIVATE_KEY_PATH

null

The local path to the file containing the RSA Private Key corresponding to the X509 certificate in DER format.

DTS_CTRL_PUBLIC_KEY_PATH

null

The local path to the file containing the RSA Public Key of the DTS Controller in DER format.

In a standard secured DTS environment, the values for the Client environment variables may look something like this:

DTS_REDIS_HOST_NAME=dts-server # Host name for the machine running the Docker platform on which DTS is deployed

DTS_REDIS_PORT=7877 # The default port the DTS contained Redis server is mapped to

DTS_CLIENT_NAME=test1 # Assuming the host name of the machine running the client is "workstation0", the client will be known as "test1@workstation0"

DTS_DEBUG_LOGGING=true

DTS_ENABLE_SECURITY=true

DTS_X509_CERTIFICATE_PATH=/home/dts/client/security/test1.crt

DTS_RSA_PRIVATE_KEY_PATH=/home/dts/client/security/test1.key.der

DTS_CTRL_PUBLIC_KEY_PATH=/home/dts/client/security/ca.pubkey.der

 

Usage

 

The usage of the .NET Client Library is best illustrated by example. Please see:

Direct Usage Example

Custom Implementation Example