Soenneker.Utils.Environment 11.0.799

Prefix Reserved
dotnet add package Soenneker.Utils.Environment --version 11.0.799
                    
NuGet\Install-Package Soenneker.Utils.Environment -Version 11.0.799
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Utils.Environment" Version="11.0.799" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.Environment" Version="11.0.799" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.Environment" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Utils.Environment --version 11.0.799
                    
#r "nuget: Soenneker.Utils.Environment, 11.0.799"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Utils.Environment@11.0.799
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Utils.Environment&version=11.0.799
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.Environment&version=11.0.799
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Utils.Environment

Static helpers for strict environment-variable lookup, cached pipeline detection, and exception-safe machine-name access.

Installation

dotnet add package Soenneker.Utils.Environment

Pipeline detection and delay

Set PipelineEnvironment=true before the process first reads EnvironmentUtil.IsPipeline:

if (EnvironmentUtil.IsPipeline)
{
    await EnvironmentUtil.PipelineDelay(2_000, cancellationToken);
}

IsPipeline parses true case-insensitively and caches the result for the life of the process. Changes to the environment variable after the first read are not observed.

PipelineDelay() waits only when pipeline mode is enabled and the requested delay is positive. It writes an information event through Serilog's global Log when that level is enabled. Outside pipeline mode it returns immediately.

Required variables

string token = EnvironmentUtil.GetVariableStrict("SERVICE_TOKEN");

GetVariableStrict() throws when the variable name or resolved value is null or empty. It does not trim values, so a whitespace-only value is returned unchanged. Avoid including secret values in exception messages or logs at the call site.

Machine name

string machineName = EnvironmentUtil.GetMachineName();

The machine name is cached on first access. If the platform lookup throws, the method logs a warning through Serilog and caches the literal value Unknown instead.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Soenneker.Utils.Environment:

Package Downloads
Soenneker.Managers.Runners

Handles Runner operations and coordination

Soenneker.Messages.Base

A fundamental Azure Service Bus message class

Soenneker.AdaptiveCard.Util

A utility library for Adaptive Card construction

Soenneker.Tests.Attributes.Local

Run locally, skip in pipelines.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.799 1,837 11/15/2026
11.0.798 5,808 11/11/2026
11.0.797 2,032 11/11/2026
11.0.796 323 11/11/2026
11.0.794 640 11/11/2026
11.0.793 1,391 11/11/2026
11.0.792 805 11/10/2026
11.0.791 12,999 11/3/2026
11.0.790 455 11/3/2026
11.0.789 2,034 11/2/2026
11.0.788 1,049 11/2/2026
11.0.787 14,029 10/26/2026
11.0.786 650 10/26/2026
4.0.785 17,550 10/15/2026
4.0.784 317 10/14/2026
4.0.783 1,125 10/14/2026
4.0.782 1,638 10/14/2026
4.0.780 1,548 10/14/2026
4.0.779 114 10/14/2026
4.0.770 3,099 10/13/2026
Loading failed

Update dependency Soenneker.Extensions.String to 11.0.821 (#943)