MVFC.Aspire.Helpers.Gotenberg
13.1.0
dotnet add package MVFC.Aspire.Helpers.Gotenberg --version 13.1.0
NuGet\Install-Package MVFC.Aspire.Helpers.Gotenberg -Version 13.1.0
<PackageReference Include="MVFC.Aspire.Helpers.Gotenberg" Version="13.1.0" />
<PackageVersion Include="MVFC.Aspire.Helpers.Gotenberg" Version="13.1.0" />
<PackageReference Include="MVFC.Aspire.Helpers.Gotenberg" />
paket add MVFC.Aspire.Helpers.Gotenberg --version 13.1.0
#r "nuget: MVFC.Aspire.Helpers.Gotenberg, 13.1.0"
#:package MVFC.Aspire.Helpers.Gotenberg@13.1.0
#addin nuget:?package=MVFC.Aspire.Helpers.Gotenberg&version=13.1.0
#tool nuget:?package=MVFC.Aspire.Helpers.Gotenberg&version=13.1.0
MVFC.Aspire.Helpers.Gotenberg
Helpers for integrating with Gotenberg (API for converting documents and PDFs) in .NET Aspire projects.
Motivation
Running Gotenberg locally usually means:
- Pulling the correct Docker image/tag.
- Mapping ports and exposing the HTTP endpoint to your applications.
- Hard‑coding the base URL of the PDF service in code or configuration.
With .NET Aspire you can model the container, but you still need to:
- Configure image, ports and health checks.
- Decide how to expose the base URL to each project.
- Keep host/port details in sync between the app host and your services.
MVFC.Aspire.Helpers.Gotenberg focuses exactly on this:
AddGotenberg(...)starts the officialgotenberg/gotenberg:8image with an HTTP endpoint and health check.project.WithReference(gotenberg)injectsGOTENBERG__BASE_URLso your API/worker can just read it from configuration.
Overview
This project allows you to easily add and integrate Gotenberg as a managed resource in distributed .NET Aspire applications. It simplifies provisioning the Gotenberg container and provides extension methods for configuring it in the AppHost.
Project Structure
MVFC.Aspire.Helpers.Gotenberg: Helpers and extensions library for Gotenberg.
Features
- Adds the Gotenberg container to the Aspire application.
- Manages automatic health check at
/health. - Automatically injects the service's base URL into the consuming project.
- Extension methods for quick configuration of custom ports.
Compatible Images
gotenberg/gotenberg(default tag8)
Installation
Add the NuGet package to your AppHost project:
dotnet add package MVFC.Aspire.Helpers.Gotenberg
dotnet add package Aspire.Hosting.Dotnet --version 17.0.0
Commands and examples using AddDotnetProject target a .NET 10/11 AppHost on Aspire 17. For .NET 9 AppHosts, keep Aspire 13.6.5, omit Aspire.Hosting.Dotnet 17 and use AddProject<Projects.MyApi>("api"). Adjust the project path to your AppHost.
Quick Aspire usage (AppHost)
using Aspire.Hosting;
using MVFC.Aspire.Helpers.Gotenberg;
var builder = DistributedApplication.CreateBuilder(args);
// Adds the Gotenberg container on host port 3000
var gotenberg = builder.AddGotenberg("gotenberg", port: 3000);
builder.AddDotnetProject("api-example", "../MVFC.Aspire.Helpers.Playground.Api/MVFC.Aspire.Helpers.Playground.Api.csproj")
.WithReference(gotenberg)
.WaitFor(gotenberg);
await builder.Build().RunAsync();
Reference in backend project (API, Web, etc.)
When using .WithReference(gotenberg), the AppHost will automatically inject an environment variable containing the accessible Gotenberg address so the consuming application can connect:
GOTENBERG__BASE_URL=http://localhost:<port>
Use that value to configure your HTTP client pointing to Gotenberg.
Provisioning diagram
sequenceDiagram
participant Aspire as .NET Aspire
participant Container as Gotenberg Container
Aspire->>Container: Start container (gotenberg/gotenberg)
Container-->>Aspire: Ready (port 3000 available)
Aspire->>App: Start App with GOTENBERG__BASE_URL
Fluent methods
| Method | Description |
|---|---|
WithDockerImage(image, tag) |
Overrides the Docker image or its tag used. |
AddGotenberg parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
name |
string | — | Resource name in Aspire. |
port |
int | 3000 |
HTTP port exposed on the host for communication. |
Port details and visualization
- Default mapped port:
3000(internally also3000). - Health check:
http://localhost:<port>/health.
Requirements
- .NET 9, 10 or 11
- Aspire.Hosting 13.6.5 on .NET 9; Aspire.Hosting 17.0.0 on .NET 10/11. AppHost examples use
Aspire.Hosting.Dotnet17 andAddDotnetProject; .NET 9 AppHosts retain theProjectResourcemodel. - Docker running locally
License
Apache-2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. 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. net11.0 is compatible. |
-
net10.0
- Aspire.Hosting (>= 17.0.0)
- MessagePack (>= 3.1.12)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.15)
-
net11.0
- Aspire.Hosting (>= 17.0.0)
- MessagePack (>= 3.1.12)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 11.0.0)
-
net9.0
- Aspire.Hosting (= 13.6.5)
- MessagePack (>= 3.1.12)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 9.0.3)
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 |
|---|---|---|
| 13.1.0 | 95 | 11/29/2026 |
| 13.0.0 | 98 | 11/28/2026 |
| 12.3.0 | 94 | 11/27/2026 |
| 12.2.1 | 96 | 11/27/2026 |
| 12.2.0 | 103 | 11/26/2026 |
| 12.1.0 | 96 | 11/26/2026 |
| 12.0.0 | 98 | 11/25/2026 |
| 11.0.2 | 101 | 11/21/2026 |
| 11.0.1 | 104 | 11/20/2026 |
| 11.0.0 | 105 | 11/13/2026 |
| 10.1.7 | 93 | 11/8/2026 |
| 10.1.6 | 94 | 11/8/2026 |
| 10.1.4 | 99 | 11/7/2026 |
| 10.1.3 | 118 | 11/1/2026 |
| 10.1.2 | 108 | 11/1/2026 |
| 10.1.1 | 108 | 10/31/2026 |
| 10.1.0 | 155 | 8/31/2026 |
| 10.0.0 | 143 | 8/30/2026 |
| 9.0.5 | 135 | 8/28/2026 |
| 9.0.4 | 173 | 6/26/2026 |