Common.Toolkit
1.2.0
dotnet add package Common.Toolkit --version 1.2.0
NuGet\Install-Package Common.Toolkit -Version 1.2.0
<PackageReference Include="Common.Toolkit" Version="1.2.0" />
<PackageVersion Include="Common.Toolkit" Version="1.2.0" />
<PackageReference Include="Common.Toolkit" />
paket add Common.Toolkit --version 1.2.0
#r "nuget: Common.Toolkit, 1.2.0"
#:package Common.Toolkit@1.2.0
#addin nuget:?package=Common.Toolkit&version=1.2.0
#tool nuget:?package=Common.Toolkit&version=1.2.0
Common.Toolkit
Small, dependency-light shared infrastructure building blocks for .NET services.
Namespaces
Common.Toolkit.Logging
Structured Serilog file logging with correlation-id enrichment.
using Common.Toolkit.Logging;
// At startup — file size / retention are optional (default 10 MB / 50 files):
LogManager.ConfigureLogging(logBasePath, "myServiceLogs_.file");
// Anywhere:
LogManager.CommonLogger.Information("Hello from {Service}", serviceName);
// Flow a correlation id through logs and outbound calls:
CorrelationContext.CorrelationId = Guid.NewGuid().ToString();
Every log line is stamped with the ambient CorrelationId (or SYSTEM for background work) via
CorrelationIdEnricher.
Common.Toolkit.Http
A typed, JSON-based REST client — IRestApiClient / RestApiClient. It handles serialization,
the standard headers (X-Correlation-Id, x-client-id, x-client-secret), and structured error
logging. Credentials are resolved per request so hosts stay decoupled.
Register it per host, supplying an IApiCredentialsProvider adapter over your own settings:
services.AddSingleton<IApiCredentialsProvider, MyCredentialsProvider>();
services.AddHttpClient<IRestApiClient, RestApiClient>(client =>
{
client.Timeout = TimeSpan.FromSeconds(80);
});
Versioning
Follows SemVer. Breaking changes bump the major version.
| 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
- MailKit (>= 4.17.0)
- Serilog (>= 4.4.0)
- Serilog.Sinks.File (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.