Aspire.Hosting.Go 13.4.4-preview.1.26314.3

Prefix Reserved
This is a prerelease version of Aspire.Hosting.Go.
dotnet add package Aspire.Hosting.Go --version 13.4.4-preview.1.26314.3
                    
NuGet\Install-Package Aspire.Hosting.Go -Version 13.4.4-preview.1.26314.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="Aspire.Hosting.Go" Version="13.4.4-preview.1.26314.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aspire.Hosting.Go" Version="13.4.4-preview.1.26314.3" />
                    
Directory.Packages.props
<PackageReference Include="Aspire.Hosting.Go" />
                    
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 Aspire.Hosting.Go --version 13.4.4-preview.1.26314.3
                    
#r "nuget: Aspire.Hosting.Go, 13.4.4-preview.1.26314.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 Aspire.Hosting.Go@13.4.4-preview.1.26314.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=Aspire.Hosting.Go&version=13.4.4-preview.1.26314.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Aspire.Hosting.Go&version=13.4.4-preview.1.26314.3&prerelease
                    
Install as a Cake Tool

Aspire.Hosting.Go library

Provides extension methods and resource definitions for an Aspire AppHost to configure Go applications.

Getting started

Prerequisites

The Go toolchain (go) must be available on the PATH of the machine running the AppHost. For GoLand remote debugging, Delve (dlv) must also be on the PATH.

Install the package

In your AppHost project, install the Aspire Go library with NuGet:

dotnet add package Aspire.Hosting.Go

Usage example

In the AppHost.cs file of AppHost, add a Go application resource:

var builder = DistributedApplication.CreateBuilder(args);

var api = builder.AddGoApp("api", "../go-api")
    .WithHttpEndpoint(port: 8080)
    .WithExternalHttpEndpoints()
    .WithOtlpExporter();

builder.Build().Run();

The method executes the package as go run . from the directory containing go.mod. Pass runtime arguments via .WithAppArgs(...) and pre-start module commands via .WithModTidy(), .WithModVendor(), .WithModDownload(), or .WithVetTool().

Build flags

Build-time compiler options are parameters of AddGoApp itself:

builder.AddGoApp("api", "../go-api",
    buildTags: ["integration", "netgo"],
    ldFlags: "-X main.version=1.2.3 -s -w",
    gcFlags: "all=-N -l",
    raceDetector: true);

Pass runtime arguments to the program:

builder.AddGoApp("api", "../go-api")
    .WithAppArgs("--config", "prod.yaml");

Debugging

Delve is the only Go debugger — both VS Code and GoLand use it under the hood, just in different modes. Aspire.Hosting.Go supports both modes.

VS Code (automatic, default)

VS Code debugging is enabled automatically by AddGoApp. Install the Go extension and use the normal Aspire "Start Debugging" flow. The extension launches its own dlv-dap process; the application continues to run as go run . and no extra setup is required.

GoLand or VS Code attach mode (headless Delve server)

Use WithDelveServer when you need GoLand or a VS Code "attach to remote" configuration. The application is replaced by a headless Delve server:

builder.AddGoApp("api", "../go-api")
    .WithDelveServer(port: 2345)
    .WithHttpEndpoint(port: 8080);

This launches:

dlv --headless=true --listen=127.0.0.1:2345 --api-version=2 debug .

GoLand — create a Go Remote run/debug configuration (Edit | Run Configurations):

  • Host: localhost
  • Port: 2345

VS Code — add to launch.json:

{
  "name": "Attach to api",
  "type": "go",
  "request": "attach",
  "mode": "remote",
  "host": "localhost",
  "port": 2345
}

Start the debug configuration after the resource appears as running in the Aspire dashboard. See the JetBrains docs for details.

Additional documentation

Feedback & contributing

https://github.com/dotnet/aspire

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 was computed.  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
13.4.4-preview.1.26314.3 0 6/15/2026
13.4.3-preview.1.26305.13 149 6/8/2026
13.4.2-preview.1.26303.6 153 6/3/2026
13.4.1-preview.1.26303.3 50 6/3/2026
13.4.0-preview.1.26281.18 93 6/1/2026