MVFC.Aspire.Helpers.Gotenberg 9.0.3

dotnet add package MVFC.Aspire.Helpers.Gotenberg --version 9.0.3
                    
NuGet\Install-Package MVFC.Aspire.Helpers.Gotenberg -Version 9.0.3
                    
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="MVFC.Aspire.Helpers.Gotenberg" Version="9.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MVFC.Aspire.Helpers.Gotenberg" Version="9.0.3" />
                    
Directory.Packages.props
<PackageReference Include="MVFC.Aspire.Helpers.Gotenberg" />
                    
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 MVFC.Aspire.Helpers.Gotenberg --version 9.0.3
                    
#r "nuget: MVFC.Aspire.Helpers.Gotenberg, 9.0.3"
                    
#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 MVFC.Aspire.Helpers.Gotenberg@9.0.3
                    
#: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=MVFC.Aspire.Helpers.Gotenberg&version=9.0.3
                    
Install as a Cake Addin
#tool nuget:?package=MVFC.Aspire.Helpers.Gotenberg&version=9.0.3
                    
Install as a Cake Tool

MVFC.Aspire.Helpers.Gotenberg

🇧🇷 Leia em Português

CI codecov License Platform NuGet Version NuGet Downloads

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 official gotenberg/gotenberg:8 image with an HTTP endpoint and health check.
  • project.WithReference(gotenberg) injects GOTENBERG__BASE_URL so 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

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 tag 8)

Installation

Add the NuGet package to your AppHost project:

dotnet add package MVFC.Aspire.Helpers.Gotenberg

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.AddProject<Projects.MVFC_Aspire_Helpers_Playground_Api>("api-example")
       .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 also 3000).
  • Health check: http://localhost:<port>/health.

Requirements

  • .NET 9+
  • Aspire.Hosting >= 9.5.0

License

Apache-2.0

Product 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. 
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
9.0.3 103 4/12/2026
9.0.2 90 4/12/2026
9.0.1 90 4/12/2026
9.0.0 102 4/12/2026
8.0.2 96 4/11/2026
8.0.1 111 4/3/2026
8.0.0 100 4/2/2026
7.3.3 97 3/31/2026
7.3.2 95 3/30/2026
7.3.1 101 3/30/2026
7.3.0 101 3/30/2026
7.2.2 99 3/29/2026
7.2.1 97 3/29/2026
7.2.0 94 3/29/2026
7.1.0 96 3/22/2026
6.4.4 92 3/21/2026
6.4.3 102 3/15/2026
6.4.2 102 3/15/2026
6.4.1 103 3/10/2026
6.4.0 101 3/9/2026
Loading failed