JustPlatform.Hosting
1.0.17
dotnet add package JustPlatform.Hosting --version 1.0.17
NuGet\Install-Package JustPlatform.Hosting -Version 1.0.17
<PackageReference Include="JustPlatform.Hosting" Version="1.0.17" />
<PackageVersion Include="JustPlatform.Hosting" Version="1.0.17" />
<PackageReference Include="JustPlatform.Hosting" />
paket add JustPlatform.Hosting --version 1.0.17
#r "nuget: JustPlatform.Hosting, 1.0.17"
#:package JustPlatform.Hosting@1.0.17
#addin nuget:?package=JustPlatform.Hosting&version=1.0.17
#tool nuget:?package=JustPlatform.Hosting&version=1.0.17
JustPlatform.Hosting
A foundational library for building robust ASP.NET Core services, providing out-of-the-box configuration for common patterns like health checks, metrics, logging, and more. This library is designed to bootstrap your application with sensible defaults and a clean, extensible API.
Features
- Centralized Configuration: A single
AddJustPlatform()call to set up your application's core services. - Port Management: Automatic configuration of HTTP, gRPC, and Debug ports.
- Health Checks: Pre-configured Liveness and Readiness health check endpoints (
/live,/ready) exposed on a separate debug port. - Metrics: Integrated OpenTelemetry for metrics with a Prometheus exporter endpoint (
/metrics) on the debug port. - Logging: Quick setup for Serilog.
- Swagger/OpenAPI: Automatic Swagger UI setup for development environments.
- Extensibility: Easily add your own services and middleware via
Actiondelegates.
Getting Started
To get started, install the NuGet package and use the AddJustPlatform() and UseJustPlatform() extension methods in your Program.cs.
// Program.cs
using JustPlatform.Hosting.Extensions;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
var builder = WebApplication.CreateBuilder(args);
// Add and configure platform services
builder.AddJustPlatform(
// Configure platform options
configureOptions: options =>
{
options.EnableSwagger = true;
options.Ports.HttpPort = 8080;
options.Ports.DebugPort = 8081;
options.Ports.GrpcPort = 8082;
},
// Add your own custom services
addServices: services =>
{
services.AddTransient<MyDummyService>();
},
// Add your own custom endpoints
configureEndpoints: endpoints =>
{
endpoints.MapGet("/hello", async context =>
{
await context.Response.WriteAsync("Hello, World!");
});
}
);
var app = builder.Build();
// Use all the configured platform middleware
app.UseJustPlatform();
app.Run();
// Dummy service for demonstration
public class MyDummyService { }
Configuration
Configuration is handled via the PlatformOptions class, which can be configured through appsettings.json or directly in code.
appsettings.json:
{
"PlatformOptions": {
"EnableHealthChecks": true,
"EnableMetrics": true,
"EnableSerilog": true,
"EnableSwagger": true,
"Ports": {
"HttpPort": 8080,
"GrpcPort": 8082,
"DebugPort": 8081
}
}
}
Extensibility
JustPlatform.Hosting is designed to be extensible. The AddJustPlatform method provides hooks to register your own services and middleware.
addServices: AnAction<IServiceCollection>to register your application's services.configurePipeline: AnAction<IApplicationBuilder>to add custom middleware to the request pipeline.configureEndpoints: AnAction<IEndpointRouteBuilder>to add custom endpoints, in addition to the standard controllers.
| 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
- JustPlatform.Configuration (>= 1.0.17)
- Microsoft.Extensions.Configuration (>= 10.0.2)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.2)
- Microsoft.Extensions.Hosting (>= 10.0.2)
- OpenTelemetry.Exporter.Prometheus.AspNetCore (>= 1.14.0-beta.1)
- OpenTelemetry.Extensions.Hosting (>= 1.15.0)
- OpenTelemetry.Instrumentation.AspNetCore (>= 1.15.0)
- OpenTelemetry.Instrumentation.Http (>= 1.15.0)
- OpenTelemetry.Instrumentation.Runtime (>= 1.15.0)
- Serilog.AspNetCore (>= 10.0.0)
- Swashbuckle.AspNetCore (>= 10.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.17 | 123 | 1/25/2026 |
| 1.0.16 | 93 | 1/25/2026 |
| 1.0.15 | 97 | 1/25/2026 |
| 1.0.14 | 88 | 1/23/2026 |
| 1.0.12 | 96 | 1/23/2026 |
| 1.0.11 | 88 | 1/23/2026 |
| 1.0.10 | 102 | 1/22/2026 |
| 1.0.9 | 97 | 1/21/2026 |
| 1.0.8 | 103 | 1/13/2026 |
| 1.0.7 | 87 | 1/13/2026 |
| 1.0.6 | 94 | 1/13/2026 |
| 1.0.5 | 90 | 1/11/2026 |
| 1.0.4 | 88 | 1/11/2026 |
| 1.0.1 | 100 | 1/11/2026 |