JustPlatform.Hosting 1.0.17

dotnet add package JustPlatform.Hosting --version 1.0.17
                    
NuGet\Install-Package JustPlatform.Hosting -Version 1.0.17
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JustPlatform.Hosting" Version="1.0.17" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="JustPlatform.Hosting" Version="1.0.17" />
                    
Directory.Packages.props
<PackageReference Include="JustPlatform.Hosting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add JustPlatform.Hosting --version 1.0.17
                    
#r "nuget: JustPlatform.Hosting, 1.0.17"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package JustPlatform.Hosting@1.0.17
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=JustPlatform.Hosting&version=1.0.17
                    
Install as a Cake Addin
#tool nuget:?package=JustPlatform.Hosting&version=1.0.17
                    
Install as a Cake Tool

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 Action delegates.

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: An Action<IServiceCollection> to register your application's services.
  • configurePipeline: An Action<IApplicationBuilder> to add custom middleware to the request pipeline.
  • configureEndpoints: An Action<IEndpointRouteBuilder> to add custom endpoints, in addition to the standard controllers.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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