Aspire.Hosting.Go
13.4.4-preview.1.26314.3
Prefix Reserved
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
<PackageReference Include="Aspire.Hosting.Go" Version="13.4.4-preview.1.26314.3" />
<PackageVersion Include="Aspire.Hosting.Go" Version="13.4.4-preview.1.26314.3" />
<PackageReference Include="Aspire.Hosting.Go" />
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"
#:package Aspire.Hosting.Go@13.4.4-preview.1.26314.3
#addin nuget:?package=Aspire.Hosting.Go&version=13.4.4-preview.1.26314.3&prerelease
#tool nuget:?package=Aspire.Hosting.Go&version=13.4.4-preview.1.26314.3&prerelease
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
| Product | Versions 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. |
-
net8.0
- Aspire.Hosting (>= 13.4.4)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Google.Protobuf (>= 3.34.1)
- Grpc.AspNetCore (>= 2.80.0)
- Grpc.Net.ClientFactory (>= 2.80.0)
- Grpc.Tools (>= 2.80.0)
- Humanizer.Core (>= 3.0.10)
- JsonPatch.Net (>= 3.3.0)
- KubernetesClient (>= 19.0.2)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.8)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.27)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.8)
- Microsoft.Extensions.Hosting (>= 10.0.8)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Http (>= 10.0.8)
- Microsoft.Extensions.Logging (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
- Microsoft.Extensions.Primitives (>= 10.0.8)
- ModelContextProtocol (>= 1.3.0)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.15.3)
- OpenTelemetry.Extensions.Hosting (>= 1.15.3)
- Polly.Core (>= 8.6.6)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.22.23)
- System.IO.Hashing (>= 10.0.8)
- System.Text.Json (>= 10.0.8)
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 |