Bitbound.SystemAbstractions
1.0.5
See the version list below for details.
dotnet add package Bitbound.SystemAbstractions --version 1.0.5
NuGet\Install-Package Bitbound.SystemAbstractions -Version 1.0.5
<PackageReference Include="Bitbound.SystemAbstractions" Version="1.0.5" />
<PackageVersion Include="Bitbound.SystemAbstractions" Version="1.0.5" />
<PackageReference Include="Bitbound.SystemAbstractions" />
paket add Bitbound.SystemAbstractions --version 1.0.5
#r "nuget: Bitbound.SystemAbstractions, 1.0.5"
#:package Bitbound.SystemAbstractions@1.0.5
#addin nuget:?package=Bitbound.SystemAbstractions&version=1.0.5
#tool nuget:?package=Bitbound.SystemAbstractions&version=1.0.5
Bitbound.SystemAbstractions
Operating system abstractions for .NET services: file system, processes, system environment, and the Windows registry.
Interfaces are public, implementations are internal, and everything is registered through
ServiceCollectionExtensions.
Install
dotnet add package Bitbound.SystemAbstractions
Usage
services.AddSystemAbstractions();
That registers:
| Service | Registration | Notes |
|---|---|---|
IFileSystem |
AddFileSystem() |
Files, directories, drives, streams, zip extraction, which/where.exe path resolution. |
IFileAccessPermissions |
AddFileSystem() |
Windows ACLs by WellKnownSidType, or UnixFileMode on Linux/macOS. |
IProcessManager |
AddProcesses() |
Start, inspect, and wait on processes. IProcess wraps System.Diagnostics.Process. |
ISystemEnvironment |
AddSystemEnvironment() |
Platform, RID, process id, startup paths, well-known directories. |
IRegistryManager |
AddRegistry() |
Windows only. Throws PlatformNotSupportedException elsewhere, and AddSystemAbstractions() skips it. |
The registry abstractions use their own RegistryHive, RegistryView, and RegistryValueKind enums, so the contracts
are platform-neutral and can be faked on any operating system.
Returning failures instead of throwing
IFileSystem.ResolveFilePath and IProcessManager.GetProcessOutput return Result/Result<T> from
Bitbound.SystemAbstractions.Primitives, which carry IsSuccess, Reason, and the Exception that produced the
failure.
var resolved = await fileSystem.ResolveFilePath("dotnet");
if (!resolved.IsSuccess)
{
logger.LogWarning("dotnet is not on the path: {Reason}", resolved.Reason);
}
Testing
Use the companion Bitbound.SystemAbstractions.TestUtilities
package, which provides FakeFileSystem and FakeRegistry.
| 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
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bitbound.SystemAbstractions:
| Package | Downloads |
|---|---|
|
Bitbound.SystemAbstractions.TestUtilities
In-memory fakes (file system, Windows registry), platform-specific xUnit facts/theories, and an xUnit-backed ILogger for testing services that depend on Bitbound.SystemAbstractions. |
GitHub repositories
This package is not used by any popular GitHub repositories.