|
<< 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.
To include the DTS .NET Client Library as a dependency in your project, you have two options.
A. Use your method of choice (dotnet, nuget.exe, Visual Studio) to pull the dependency from the DTS repository nuget feed:
Name: datatransitsystem
Source: https://pkgs.dev.azure.com/datatransitsystem/_packaging/datatransitsystem/nuget/v3/index.json
Package: Client
Version: 2025.1.1
Note: To get a token for authenticating to the DTS repository, please contact support.
B. Manually import the nupkg file from [DTS]/lib/net8.0
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
The usage of the .NET Client Library is best illustrated by example. Please see: