Skip to content
Documentation

Installing the .NET API

The PowerTSM .NET API is distributed as NuGet packages. This page describes how to make these packages available on a development machine and reference them from a project, either with Visual Studio or with the .NET CLI.

  • The NuGet packages must be available at a known location on the development machine. For the remainder of this guide, their location is assumed to be:

    C:\HAKOM\
  • The .NET 8 SDK must be installed. For more information, refer to the Microsoft documentation.

  • A valid HAKOM.License file must be available.

  1. Open Tools → NuGet Package Manager → Package Manager Settings.

    Visual Studio Tools menu with NuGet Package Manager and Package Manager Settings selected

  2. Select Package Sources and add a new source.

    Visual Studio Options dialog showing the NuGet Package Sources page with the button to add a new source

  3. Enter the location of the NuGet Package under Source and pick a name (HAKOM in this example), then click Update:

    NuGet Package Sources page with a new source named HAKOM pointing to the package folder

  1. Create a new project (this example uses the new command-line project template).

    Visual Studio Create a new project dialog with the console application template selected

  2. Right-click on the project in the Solution Explorer and select Manage NuGet Packages.

    Solution Explorer context menu of the project with Manage NuGet Packages selected

  3. On the top-right, under Package source, select the previously created source (HAKOM), then select the package and click Install.

    NuGet Package Manager with the HAKOM package source and the HAKOM.TSM.Net package selected and the Install button highlighted

  1. Right click on the project and select Add → Existing Item....

    Solution Explorer context menu of the project with Add and Existing Item selected

  2. Select the HAKOM.License file in the opened file chooser window.

  3. After pressing Add, select the file in the Solution Explorer, then under Properties change Copy to Output Directory to Copy if newer.

    Properties window of the HAKOM.License file with Copy to Output Directory set to Copy if newer

  1. Open a command line window and navigate to the directory you would like to start from (in our case, this will be C:\Getting Started).

  2. Create a new file Nuget.Config with the following contents:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <packageSources>
    <add key="HAKOM" value="C:\HAKOM" protocolVersion="3" />
    </packageSources>
    </configuration>
  1. Create a new console project:

    dotnet new console
  2. Add a reference to the HAKOM.TSM.Net package:

    dotnet add package HAKOM.TSM.Net --version 4.13.0

Copy your HAKOM.License file to the project directory, then add the following lines into the .csproj file:

<ItemGroup>
<None Update="HAKOM.License">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

Edit Program.cs and add the following (example) code.

flask List all time series of a repository

Section titled “ List all time series of a repository”
using HAKOM.TSM.Net.Api;
using HAKOM.Configuration.Core.Net.Api.Extensions;
using Microsoft.Extensions.Configuration;
Dictionary<string, string> configuration = new()
{
["Persistence:Repositories:Repository:MyRepository:Name"] = "MyRepository",
["Persistence:Repositories:Repository:MyRepository:Provider:Type"] = "<insert provider here>",
["Persistence:Repositories:Repository:MyRepository:Provider:Settings:Setting:Data Source"]
= "<insert data source here>",
["Persistence:Repositories:Repository:MyRepository:Provider:Settings:Setting:Password"] = "<insert password here>"
};
var tsm = ITsm.Create((container) =>
{
container.Configure(configurationBuilder =>
{
configurationBuilder.AddInMemoryCollection(configuration);
});
}, true);
var repo = await tsm.Repositories.Load("MyRepository");
var timeSeriesStore = await repo.GetTimeSeriesStore();
var searchParameters = timeSeriesStore.SearchParameters.Create(name: "*");
await foreach(var timeSeries in timeSeriesStore.Find(searchParameters))
{
Console.WriteLine($"Found time series: {timeSeries.Name}");
}

Build and run the application. When using the .NET CLI, run:

dotnet run

It should list all the time series in the configured database.

© 2026 Volue.Version v0.6.38017 November 2026