Soenneker.Utils.Environment
4.0.724
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Utils.Environment --version 4.0.724
NuGet\Install-Package Soenneker.Utils.Environment -Version 4.0.724
<PackageReference Include="Soenneker.Utils.Environment" Version="4.0.724" />
<PackageVersion Include="Soenneker.Utils.Environment" Version="4.0.724" />
<PackageReference Include="Soenneker.Utils.Environment" />
paket add Soenneker.Utils.Environment --version 4.0.724
#r "nuget: Soenneker.Utils.Environment, 4.0.724"
#:package Soenneker.Utils.Environment@4.0.724
#addin nuget:?package=Soenneker.Utils.Environment&version=4.0.724
#tool nuget:?package=Soenneker.Utils.Environment&version=4.0.724
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Serilog (>= 4.4.0)
- Soenneker.Atomics.Strings (>= 4.0.19)
- Soenneker.Atomics.ValueNullableBools (>= 4.0.34)
- Soenneker.Enums.DeployEnvironment (>= 4.0.236)
- Soenneker.Extensions.String (>= 4.0.735)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Soenneker.Utils.Environment:
| Package | Downloads |
|---|---|
|
Soenneker.Messages.Base
A fundamental Azure Service Bus message class |
|
|
Soenneker.Managers.Runners
Handles Runner operations and coordination |
|
|
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 |
|---|---|---|
| 4.0.731 | 0 | 9/7/2026 |
| 4.0.730 | 0 | 9/7/2026 |
| 4.0.729 | 5,859 | 9/5/2026 |
| 4.0.728 | 879 | 9/4/2026 |
| 4.0.727 | 4,609 | 9/4/2026 |
| 4.0.726 | 288 | 9/4/2026 |
| 4.0.725 | 14,584 | 8/31/2026 |
| 4.0.724 | 1,961 | 8/31/2026 |
| 4.0.723 | 2,747 | 8/31/2026 |
| 4.0.722 | 258 | 8/30/2026 |
| 4.0.721 | 645 | 8/30/2026 |
| 4.0.720 | 1,524 | 8/30/2026 |
| 4.0.719 | 783 | 8/30/2026 |
| 4.0.717 | 733 | 8/30/2026 |
| 4.0.716 | 321 | 8/30/2026 |
| 4.0.715 | 83 | 8/30/2026 |
| 4.0.714 | 568 | 8/30/2026 |
| 4.0.712 | 127 | 8/29/2026 |
| 4.0.711 | 264 | 8/29/2026 |
| 4.0.710 | 3,005 | 8/29/2026 |
Updated NuGet packages