Eigenverft.NetLib.Infrastructure
1.0.20264.39539
See the version list below for details.
dotnet add package Eigenverft.NetLib.Infrastructure --version 1.0.20264.39539
NuGet\Install-Package Eigenverft.NetLib.Infrastructure -Version 1.0.20264.39539
<PackageReference Include="Eigenverft.NetLib.Infrastructure" Version="1.0.20264.39539" />
<PackageVersion Include="Eigenverft.NetLib.Infrastructure" Version="1.0.20264.39539" />
<PackageReference Include="Eigenverft.NetLib.Infrastructure" />
paket add Eigenverft.NetLib.Infrastructure --version 1.0.20264.39539
#r "nuget: Eigenverft.NetLib.Infrastructure, 1.0.20264.39539"
#:package Eigenverft.NetLib.Infrastructure@1.0.20264.39539
#addin nuget:?package=Eigenverft.NetLib.Infrastructure&version=1.0.20264.39539
#tool nuget:?package=Eigenverft.NetLib.Infrastructure&version=1.0.20264.39539
🧱 Eigenverft.NetLib.Infrastructure
Small, reusable infrastructure primitives for .NET applications and Generic Host-based services.
Provides predictable, executable-rooted application directories with automatic creation and writable validation.
Also includes generic reversible string transforms, JSON-safe Base92 representation, machine binding, DPAPI machine-scope transforms, and certificate primitives.
✨ At a glance
| Package | Eigenverft.NetLib.Infrastructure |
| Primary API | HostApplicationBuilderFactory.CreateWithDefaultDirectory() |
| Root | AppContext.BaseDirectory |
| Default folders | AppLogs, AppData, AppState, AppCerts, AppSettings |
| Host integration | Available before Build() and through DI afterwards |
| Target frameworks | .NET 8 and .NET 10 |
| License | MIT |
📦 Installation
dotnet add package Eigenverft.NetLib.Infrastructure
Or with the NuGet Package Manager:
Install-Package Eigenverft.NetLib.Infrastructure
🚀 Quick start
using Eigenverft.NetLib.Infrastructure.Hosting.DirectoryLayout;
var builder = HostApplicationBuilderFactory.CreateWithDefaultDirectory();
var directories = builder.GetDirectoryLayout();
string settingsDirectory =
directories[DefaultDirectory.ApplicationSettings];
Console.WriteLine(settingsDirectory);
using IHost host = builder.Build();
await host.RunAsync();
The standard layout is created directly below the executable directory:
<application>/
├─ AppLogs/
├─ AppData/
├─ AppState/
├─ AppCerts/
└─ AppSettings/
Each directory is created during registration and checked for write access, so path or permission problems fail early during startup.
The same layout is registered as IAppDirectoryLayout after Build(), so normal constructor injection works as expected:
public sealed class Worker(
ILogger<Worker> logger,
IAppDirectoryLayout directories) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
logger.LogInformation(
"Using application data directory {Directory}",
directories[DefaultDirectory.ApplicationData]);
await Task.Delay(Timeout.Infinite, stoppingToken);
}
}
🗂️ Override standard folder names
builder.AddDefaultDirectoryLayout(
new Dictionary<DefaultDirectory, string>
{
[DefaultDirectory.ApplicationData] = "Data",
[DefaultDirectory.ApplicationLogFiles] = "Logs",
});
Unspecified standard directories retain their defaults.
🧩 Custom directory layouts
builder.AddDirectoryLayout(
new Dictionary<string, string>
{
["Cache"] = "cache",
["Imports"] = "incoming",
});
string imports = builder.GetDirectoryLayout()["Imports"];
Folder mappings are intentionally direct children of the application root. Rooted paths, nested paths, and traversal patterns are rejected.
🔧 Without Generic Host
AppDirectoryLayout directories = AppDirectoryLayoutFactory.CreateDefault();
An explicit root can also be supplied to the factory for tools, tests, or custom bootstrap scenarios.
Certificates
Eigenverft.NetLib.Infrastructure.Security.Certificates provides host-independent X.509 helpers:
SelfSignedCertificateFactory.Create(...)creates caller-owned self-signed certificates for TLS server/client, code-signing, and email-protection purposes using RSA or ECDSA profiles.ManagedCertificateFile.LoadOrCreate(...)loads a managed PFX or returns a policy-controlled recovery certificate.CertificateRecoveryMode.PreserveExistingis the safe default and does not overwrite an existing unusable PFX.
The certificate APIs have no ASP.NET Core, Kestrel, SNI, configuration, or logging dependency.
🎯 Target frameworks
The package ships dedicated assets for:
net8.0net10.0
A .NET 9 consumer can use the compatible net8.0 asset.
🔗 Project links
📄 License
Licensed under the MIT License by Eigenverft.
Made with ❤️ by Eigenverft
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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.Hosting (>= 10.0.0)
-
net8.0
- Microsoft.Extensions.Hosting (>= 8.0.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Eigenverft.NetLib.Infrastructure:
| Package | Downloads |
|---|---|
|
Eigenverft.WebLib.Infrastructure
ASP.NET Core infrastructure helpers including web-host directory setup, request-pipeline middleware, typed request features, Data Protection transforms, and Kestrel/SNI configuration. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.20264.61091 | 254 | 8/28/2026 |
| 1.0.20264.61042 | 126 | 8/28/2026 |
| 1.0.20264.60152 | 152 | 8/27/2026 |
| 1.0.20264.58446 | 161 | 8/26/2026 |
| 1.0.20264.58187 | 135 | 8/26/2026 |
| 1.0.20264.56982 | 146 | 8/25/2026 |
| 1.0.20264.56973 | 123 | 8/25/2026 |
| 1.0.20264.55823 | 152 | 8/24/2026 |
| 1.0.20264.55680 | 138 | 8/24/2026 |
| 1.0.20264.51349 | 128 | 8/21/2026 |
| 1.0.20264.50794 | 147 | 8/20/2026 |
| 1.0.20264.45635 | 136 | 8/16/2026 |
| 1.0.20264.40014 | 136 | 8/12/2026 |
| 1.0.20264.39915 | 121 | 8/12/2026 |
| 1.0.20264.39799 | 129 | 8/12/2026 |
| 1.0.20264.39698 | 131 | 8/12/2026 |
| 1.0.20264.39599 | 115 | 8/12/2026 |
| 1.0.20264.39578 | 116 | 8/12/2026 |
| 1.0.20264.39539 | 121 | 8/12/2026 |
| 1.0.20264.39528 | 121 | 8/12/2026 |