From b27a019b91e9df5b10ab556abd2a27d6cfba7fe2 Mon Sep 17 00:00:00 2001 From: Joel Dixon Date: Thu, 18 Jun 2026 11:25:34 -0500 Subject: [PATCH 1/7] Add a nuget.config to ensure only nuget.org packages are used to build the examples --- nuget.config | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 nuget.config diff --git a/nuget.config b/nuget.config new file mode 100644 index 0000000..e11e96e --- /dev/null +++ b/nuget.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file From 6413c33daceb9f07dc0a73e3ff00828cb97a2ba2 Mon Sep 17 00:00:00 2001 From: Joel Dixon Date: Thu, 18 Jun 2026 11:29:33 -0500 Subject: [PATCH 2/7] Add a workflow to build the data store examples and metadata-builder example. --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..cf6a165 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: Build + +on: + push: + branches: [main, releases/**] + pull_request: + branches: [main, releases/**] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + build: + name: Build on Windows + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + + - name: Build examples + run: dotnet build examples/Examples.slnx + + - name: Build metadata-builder + run: dotnet build metadata-builder/MetadataBuilder.slnx From 1b23322d328fac99815a67a7f04cd48b2dc09ba0 Mon Sep 17 00:00:00 2001 From: Joel Dixon <38357562+dixonjoel@users.noreply.github.com> Date: Mon, 22 Jun 2026 13:04:10 -0500 Subject: [PATCH 3/7] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf6a165..5fa1d05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,8 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 - + with: + dotnet-version: '8.0.x' - name: Build examples run: dotnet build examples/Examples.slnx From b1408dbe9cf07de6a39084df69b48f835c2d1988 Mon Sep 17 00:00:00 2001 From: Joel Dixon Date: Thu, 18 Jun 2026 11:35:48 -0500 Subject: [PATCH 4/7] Run the metadata-builder build step even if the examples build fails. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5fa1d05..09eb3bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,4 +28,5 @@ jobs: run: dotnet build examples/Examples.slnx - name: Build metadata-builder + if: always() run: dotnet build metadata-builder/MetadataBuilder.slnx From 71c48f1a8f082cd9bec0c0492c2504cdeea71cbd Mon Sep 17 00:00:00 2001 From: Joel Dixon Date: Tue, 23 Jun 2026 10:25:02 -0500 Subject: [PATCH 5/7] Add formatting / SA checks --- .github/workflows/build.yml | 8 ++++++++ examples/DataStoreContext/DataStoreContext.cs | 6 +++--- examples/Extension Attributes/Extension Attributes.cs | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 09eb3bc..4977da5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,14 @@ jobs: - name: Build examples run: dotnet build examples/Examples.slnx + - name: Check formatting (examples) + if: always() + run: dotnet format examples/Examples.slnx --verify-no-changes + - name: Build metadata-builder if: always() run: dotnet build metadata-builder/MetadataBuilder.slnx + + - name: Check formatting (metadata-builder) + if: always() + run: dotnet format metadata-builder/MetadataBuilder.slnx --verify-no-changes diff --git a/examples/DataStoreContext/DataStoreContext.cs b/examples/DataStoreContext/DataStoreContext.cs index 6d82b98..6e4a256 100644 --- a/examples/DataStoreContext/DataStoreContext.cs +++ b/examples/DataStoreContext/DataStoreContext.cs @@ -16,7 +16,7 @@ public class DataStoreContext : IDisposable private const string DataStoreIngestDirectoryPathEnvVar = "NIDATASTORE_DATASTORESETTINGS__INGESTDIRECTORY"; private const string DataStoreFailedIngestDirectoryPathEnvVar = "NIDATASTORE_DATASTORESETTINGS__FAILEDINGESTDIRECTORY"; private const string DataStoreTdmsExpirationSecondsEnvName = "NIDATASTORE_DATASTORESETTINGS__TDMSFILECACHEEXPIRATIONSECONDS"; - + private const string DefaultFolderName = "temp_data"; private readonly string? _baseDirectoryPath; @@ -112,12 +112,12 @@ private string GetBaseDirectoryHash() { string baseDirectoryPath = GetBaseDirectoryPath(); string resolvedPath = Path.GetFullPath(baseDirectoryPath); - + using (var sha256 = SHA256.Create()) { byte[] pathBytes = Encoding.UTF8.GetBytes(resolvedPath); byte[] hashBytes = sha256.ComputeHash(pathBytes); - + // Convert to hex string and take first 32 characters StringBuilder sb = new StringBuilder(); for (int i = 0; i < Math.Min(16, hashBytes.Length); i++) diff --git a/examples/Extension Attributes/Extension Attributes.cs b/examples/Extension Attributes/Extension Attributes.cs index 70890f1..c6d7b3c 100644 --- a/examples/Extension Attributes/Extension Attributes.cs +++ b/examples/Extension Attributes/Extension Attributes.cs @@ -1,5 +1,5 @@ using NationalInstruments; -using NationalInstruments.DataStore.Utilities; +using NationalInstruments.DataStore.Utilities; using NationalInstruments.MeasurementLink.Discovery.V1; using NationalInstruments.Measurements.Data.V1; using NationalInstruments.Measurements.Metadata.V1; From 14062032ee7ac78ec6513c0e8e3308be32557398 Mon Sep 17 00:00:00 2001 From: Joel Dixon Date: Mon, 29 Jun 2026 10:42:42 -0500 Subject: [PATCH 6/7] Update package versions to latest published --- examples/Directory.Packages.props | 2 +- metadata-builder/Directory.Packages.props | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Directory.Packages.props b/examples/Directory.Packages.props index cd4d716..96983a4 100644 --- a/examples/Directory.Packages.props +++ b/examples/Directory.Packages.props @@ -6,7 +6,7 @@ - + \ No newline at end of file diff --git a/metadata-builder/Directory.Packages.props b/metadata-builder/Directory.Packages.props index 70b028b..9855072 100644 --- a/metadata-builder/Directory.Packages.props +++ b/metadata-builder/Directory.Packages.props @@ -5,8 +5,8 @@ - - + + \ No newline at end of file From 8cde82b302f9baba40c02c33bd03743cf5eaaab8 Mon Sep 17 00:00:00 2001 From: Joel Dixon Date: Mon, 29 Jun 2026 10:52:57 -0500 Subject: [PATCH 7/7] Update README - we now go to the temp_data folder and not the default repo --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 30678e7..dacbc3a 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,14 @@ # Datastore .NET Examples -This repo contains the source code for examples that show how to use the .NET API of NI Measurement Data Services. -These examples do not go through any build process, you can simply copy them to a system that has the necessary -software installed. +This repo contains the source code for examples that show how to use the .NET API of NI Measurement Data Services. These examples do not go through any build process, you can simply copy them to a system that has the necessary software installed. ## Running the Examples 1. Clone or download this repository. -2. Copy the contents of `Examples` to a system that has NI Measurement Data Services and the .NET framework installed. +2. Copy the contents of `examples` to a system that has NI Measurement Data Services including .NET installed. 3. Compile and run the console applications defined in the .csproj files in the `Examples` directory. -4. Be aware that running these examples will publish data to the default datastore location on your system. Data that is -published by a certain example may show up in queries from other examples or from your own Measurement Data Services application. +4. Running these examples will publish data to the `examples/temp_data` folder in the repo. ## Installation -As a prerequisite to using the DataStore .NET API, you must install Measurement Data Services -Software 2026 Q1 or later on your system. You can download and install this software using -[NI Package Manager](https://www.ni.com/en/support/downloads/software-products/download.package-manager.html). \ No newline at end of file +As a prerequisite to using the DataStore .NET API, you must install Measurement Data Services Software 2026 Q1 or later on your system. You can download and install this software using [NI Package Manager](https://www.ni.com/en/support/downloads/software-products/download.package-manager.html).