CommunityToolkit.Aspire.Hosting.Golang 13.0.1-beta.467

Prefix Reserved
This is a prerelease version of CommunityToolkit.Aspire.Hosting.Golang.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CommunityToolkit.Aspire.Hosting.Golang --version 13.0.1-beta.467
                    
NuGet\Install-Package CommunityToolkit.Aspire.Hosting.Golang -Version 13.0.1-beta.467
                    
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="CommunityToolkit.Aspire.Hosting.Golang" Version="13.0.1-beta.467" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.Aspire.Hosting.Golang" Version="13.0.1-beta.467" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.Aspire.Hosting.Golang" />
                    
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 CommunityToolkit.Aspire.Hosting.Golang --version 13.0.1-beta.467
                    
#r "nuget: CommunityToolkit.Aspire.Hosting.Golang, 13.0.1-beta.467"
                    
#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 CommunityToolkit.Aspire.Hosting.Golang@13.0.1-beta.467
                    
#: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=CommunityToolkit.Aspire.Hosting.Golang&version=13.0.1-beta.467&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Hosting.Golang&version=13.0.1-beta.467&prerelease
                    
Install as a Cake Tool

CommunityToolkit.Aspire.Hosting.Golang library

Provides extensions methods and resource definitions for the .NET Aspire AppHost to support running Golang applications.

Getting Started

Install the package

In your AppHost project, install the package using the following command:

dotnet add package CommunityToolkit.Aspire.Hosting.Golang

Example usage

Then, in the Program.cs file of AppHost, define a Golang resource, then call AddGolangApp:

var golang = builder.AddGolangApp("golang", "../gin-api")
    .WithHttpEndpoint(env: "PORT");

The PORT environment variable is used to determine the port the Golang application should listen on. It is randomly assigned by the .NET Aspire. The name of the environment variable can be changed by passing a different value to the WithHttpEndpoint method.

To have the Golang application listen on the correct port, you can use the following code in your Golang application:

r.Run(":"+os.Getenv("PORT"))

Publishing

When publishing your Aspire application, the Golang resource automatically generates a multi-stage Dockerfile for containerization. This means you don't need to manually create a Dockerfile for your Golang application.

Automatic Version Detection

The integration automatically detects the Go version to use by:

  1. Checking the go.mod file for the Go version directive
  2. Falling back to the installed Go toolchain version
  3. Using Go 1.23 as the default if no version is detected

Customizing Base Images

You can customize the base images used in the Dockerfile:

var golang = builder.AddGolangApp("golang", "../gin-api")
    .WithHttpEndpoint(env: "PORT")
    .WithDockerfileBaseImage(
        buildImage: "golang:1.22-alpine",
        runtimeImage: "alpine:3.20");

Generated Dockerfile

The automatically generated Dockerfile:

  • Uses the detected or default Go version (e.g., golang:1.22) as the build stage
  • Uses alpine:3.21 as the runtime stage for a smaller final image
  • Installs CA certificates in the runtime image for HTTPS support
  • Respects your build tags if specified
  • Builds the executable specified in your AddGolangApp call

This automatic Dockerfile generation happens when you publish your Aspire application and requires no additional configuration.

Additional Information

https://learn.microsoft.com/dotnet/aspire/community-toolkit/hosting-golang

Feedback & contributing

https://github.com/CommunityToolkit/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 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
13.0.1-beta.468 617 12/3/2025
13.0.1-beta.467 607 12/3/2025
13.0.0 619 11/25/2025
13.0.0-beta.462 129 11/25/2025
13.0.0-beta.456 129 11/23/2025
13.0.0-beta.454 80 11/23/2025
13.0.0-beta.453 100 11/22/2025
13.0.0-beta.450 109 11/22/2025
13.0.0-beta.448 105 11/22/2025
13.0.0-beta.444 422 11/17/2025
13.0.0-beta.443 401 11/17/2025
13.0.0-beta.440 90 11/15/2025
13.0.0-beta.439 235 11/12/2025
13.0.0-beta.438 223 11/12/2025
13.0.0-beta.436 224 11/12/2025
13.0.0-beta.435 232 11/11/2025
13.0.0-beta.433 148 11/10/2025
13.0.0-beta.432 148 11/10/2025
13.0.0-beta.431 134 11/6/2025
13.0.0-beta.430 137 11/6/2025
9.9.0 290 11/3/2025
9.9.0-beta.427 145 11/3/2025
9.8.1-beta.426 139 11/3/2025
9.8.1-beta.424 134 10/28/2025
9.8.1-beta.420 128 10/27/2025
9.8.1-beta.419 126 10/27/2025
9.8.1-beta.417 130 10/27/2025
9.8.1-beta.414 130 10/24/2025
9.8.1-beta.413 128 10/22/2025
9.8.1-beta.410 123 10/16/2025
9.8.1-beta.408 114 10/16/2025
9.8.1-beta.407 119 10/16/2025
9.8.1-beta.406 128 10/15/2025
9.8.0 1,125 9/26/2025
9.8.0-beta.405 121 10/15/2025
9.8.0-beta.404 125 10/13/2025
9.8.0-beta.402 131 9/29/2025
9.8.0-beta.401 127 9/29/2025
9.8.0-beta.399 126 9/26/2025
9.8.0-beta.398 127 9/25/2025
9.8.0-beta.397 138 9/25/2025
9.8.0-beta.395 132 9/24/2025
9.8.0-beta.394 130 9/23/2025
9.8.0-beta.393 134 9/23/2025
9.8.0-beta.392 138 9/23/2025
9.8.0-beta.389 257 9/18/2025
9.8.0-beta.388 268 9/16/2025
9.8.0-beta.386 205 9/15/2025
9.8.0-beta.385 209 9/15/2025
9.8.0-beta.384 56 9/13/2025
9.8.0-beta.376 135 9/8/2025
9.8.0-beta.375 67 9/6/2025
9.8.0-beta.373 138 9/5/2025
9.8.0-beta.372 147 9/4/2025
9.8.0-beta.370 131 9/2/2025
9.8.0-beta.364 131 9/1/2025
9.7.2 7,189 8/29/2025
9.7.2-beta.362 179 8/29/2025
9.7.2-beta.361 177 8/29/2025
9.7.2-beta.360 178 8/29/2025
9.7.2-beta.359 167 8/28/2025
9.7.2-beta.358 174 8/28/2025
9.7.2-beta.357 179 8/28/2025
9.7.1 228 8/27/2025
9.7.1-beta.355 178 8/27/2025
9.7.1-beta.354 177 8/27/2025
9.7.1-beta.353 172 8/27/2025
9.7.1-beta.352 174 8/27/2025
9.7.1-beta.351 176 8/27/2025
9.7.1-beta.348 147 8/14/2025
9.7.1-beta.344 247 8/10/2025
9.7.1-beta.343 246 8/8/2025
9.7.1-beta.342 212 8/7/2025
9.7.1-beta.341 219 8/6/2025
9.7.1-beta.340 197 8/5/2025
9.7.1-beta.339 200 8/5/2025
9.7.0 216 8/1/2025
9.7.0-beta.337 90 8/1/2025
9.7.0-beta.336 100 8/1/2025
9.7.0-beta.335 99 8/1/2025
9.7.0-beta.333 108 7/30/2025
9.6.1-beta.332 107 7/30/2025
9.6.1-beta.331 109 7/30/2025
9.6.1-beta.330 104 7/30/2025
9.6.1-beta.329 108 7/30/2025
9.6.1-beta.328 116 7/29/2025
9.6.1-beta.327 125 7/28/2025
9.6.1-beta.326 129 7/28/2025
9.6.0 202 7/10/2025
9.6.0-beta.324 137 7/10/2025
9.5.1-beta.323 129 7/10/2025
9.5.1-beta.322 139 7/10/2025
9.5.1-beta.321 137 7/10/2025
9.5.1-beta.320 133 7/9/2025
9.5.1-beta.319 133 7/8/2025
9.5.1-beta.318 137 7/2/2025
9.5.1-beta.317 132 6/30/2025
9.5.1-beta.315 134 6/26/2025
9.5.1-beta.314 133 6/23/2025
9.5.1-beta.313 136 6/20/2025
9.5.1-beta.312 151 6/20/2025
9.5.1-beta.311 162 6/18/2025
9.5.1-beta.310 160 6/17/2025
9.5.1-beta.309 148 6/17/2025
9.5.1-beta.308 146 6/17/2025
9.5.1-beta.307 237 6/16/2025
9.5.1-beta.306 296 6/11/2025
9.5.1-beta.305 132 6/7/2025
9.5.1-beta.304 144 6/6/2025
9.5.1-beta.303 130 6/4/2025
9.5.1-beta.302 150 6/4/2025
9.5.1-beta.301 166 6/2/2025
9.5.1-beta.300 162 5/28/2025
9.5.0 392 5/27/2025
9.5.0-beta.299 154 5/27/2025
9.5.0-beta.298 144 5/26/2025
9.5.0-beta.297 117 5/24/2025
9.5.0-beta.296 107 5/24/2025
9.5.0-beta.295 85 5/24/2025
9.4.1-beta.291 145 5/19/2025
9.4.1-beta.289 155 5/16/2025
9.4.1-beta.288 233 5/16/2025
9.4.1-beta.287 206 5/16/2025
9.4.1-beta.286 203 5/16/2025
9.4.1-beta.285 223 5/14/2025
9.4.1-beta.284 242 5/13/2025
9.4.1-beta.283 236 5/12/2025
9.4.1-beta.282 155 5/7/2025
9.4.1-beta.280 159 5/2/2025
9.4.1-beta.279 160 5/2/2025
9.4.1-beta.277 163 4/23/2025
9.4.1-beta.276 150 4/23/2025
9.4.1-beta.275 166 4/23/2025
9.4.1-beta.274 160 4/23/2025
9.4.1-beta.273 175 4/23/2025
9.4.1-beta.272 169 4/23/2025
9.4.1-beta.271 164 4/23/2025
9.4.1-beta.270 188 4/20/2025
9.4.0 230 4/20/2025
9.4.0-beta.269 186 4/20/2025
9.4.0-beta.268 182 4/20/2025
9.3.1-beta.267 162 4/20/2025
9.3.1-beta.266 94 4/19/2025
9.3.1-beta.265 204 4/15/2025
9.3.1-beta.264 198 4/15/2025
9.3.1-beta.263 191 4/15/2025
9.3.1-beta.262 183 4/15/2025
9.3.1-beta.260 156 4/10/2025
9.3.1-beta.259 171 4/8/2025
9.3.1-beta.258 165 4/8/2025
9.3.1-beta.257 174 4/8/2025
9.3.1-beta.256 171 4/8/2025
9.3.1-beta.255 163 4/8/2025
9.3.1-beta.254 166 4/8/2025
9.3.1-beta.253 169 4/1/2025
9.3.1-beta.252 135 3/27/2025
9.3.1-beta.250 160 3/27/2025
9.3.1-beta.249 164 3/27/2025
9.3.1-beta.248 147 3/27/2025
9.3.1-beta.247 161 3/27/2025
9.3.1-beta.244 495 3/25/2025
9.3.1-beta.242 491 3/24/2025
9.3.1-beta.241 177 3/19/2025
9.3.0 250 3/19/2025
9.3.0-beta.239 164 3/19/2025
9.2.2-beta.237 171 3/19/2025
9.2.2-beta.236 142 3/14/2025
9.2.2-beta.230 139 3/13/2025
9.2.2-beta.229 174 3/13/2025
9.2.2-beta.228 174 3/11/2025
9.2.2-beta.227 173 3/11/2025
9.2.2-beta.226 179 3/11/2025
9.2.2-beta.225 146 3/11/2025
9.2.2-beta.224 175 3/11/2025
9.2.2-beta.223 151 3/10/2025
9.2.2-beta.222 189 3/10/2025
9.2.2-beta.220 181 3/9/2025
9.2.2-beta.218 192 3/9/2025
9.2.2-beta.217 216 3/7/2025
9.2.2-beta.216 193 3/7/2025
9.2.2-beta.215 210 3/7/2025
9.2.2-beta.214 201 3/5/2025
9.2.2-beta.213 200 3/5/2025
9.2.2-beta.212 220 3/5/2025
9.2.2-beta.211 225 3/4/2025
9.2.2-beta.210 216 3/4/2025
9.2.2-beta.208 105 3/3/2025
9.2.1 188 3/3/2025
9.2.1-beta.207 131 3/2/2025
9.2.1-beta.206 84 3/1/2025
9.2.1-beta.205 110 2/27/2025
9.2.1-beta.204 84 2/26/2025
9.2.1-beta.203 80 2/26/2025
9.2.0 402 2/26/2025
9.2.0-beta.202 103 2/26/2025
9.2.0-beta.201 112 2/26/2025
9.2.0-beta.199 111 2/26/2025
9.2.0-beta.198 89 2/26/2025
9.1.1-beta.197 93 2/25/2025
9.1.1-beta.196 113 2/25/2025
9.1.1-beta.195 84 2/25/2025
9.1.1-beta.194 92 2/25/2025
9.1.1-beta.193 113 2/25/2025
9.1.1-beta.192 108 2/24/2025
9.1.1-beta.191 106 2/24/2025
9.1.1-beta.190 113 2/19/2025
9.1.1-beta.189 86 2/19/2025
9.1.1-beta.188 115 2/19/2025
9.1.1-beta.187 116 2/19/2025
9.1.1-beta.183 121 2/18/2025
9.1.1-beta.182 123 2/18/2025
9.1.1-beta.181 133 2/18/2025
9.1.1-beta.180 111 2/17/2025
9.1.1-beta.178 119 2/17/2025
9.1.1-beta.177 125 2/12/2025
9.1.1-beta.176 113 2/11/2025
9.1.1-beta.175 98 2/11/2025
9.1.1-beta.173 123 2/10/2025
9.1.1-beta.169 99 2/6/2025
9.1.1-beta.168 103 2/5/2025
9.1.1-beta.166 86 2/5/2025
9.1.1-beta.165 105 2/5/2025
9.1.1-beta.164 104 2/3/2025
9.1.1-beta.162 100 2/3/2025
9.1.1-beta.155 104 1/30/2025
9.1.1-beta.154 78 1/30/2025
9.1.1-beta.153 96 1/30/2025
9.1.1-beta.152 77 1/29/2025
9.1.1-beta.150 113 1/29/2025
9.1.1-beta.148 100 1/26/2025
9.1.1-beta.147 105 1/26/2025
9.1.1-beta.146 107 1/23/2025
9.1.1-beta.145 95 1/22/2025
9.1.1-beta.144 100 1/22/2025
9.1.1-beta.142 75 1/22/2025
9.1.1-beta.140 110 1/22/2025
9.1.1-beta.139 103 1/21/2025
9.1.1-beta.138 101 1/20/2025
9.1.1-beta.137 73 1/17/2025
9.1.1-beta.136 96 1/15/2025
9.1.1-beta.135 55 1/15/2025
9.1.1-beta.134 70 1/15/2025
9.1.1-beta.128 94 1/9/2025
9.1.1-beta.127 83 1/9/2025
9.1.1-beta.126 98 1/9/2025
9.1.1-beta.125 97 1/9/2025
9.1.1-beta.124 103 1/9/2025
9.1.0 2,321 12/12/2024
9.1.0-beta.123 110 1/3/2025
9.1.0-beta.122 91 1/3/2025
9.1.0-beta.121 115 1/2/2025
9.1.0-beta.120 103 12/30/2024
9.1.0-beta.119 104 12/30/2024
9.1.0-beta.118 90 12/30/2024
9.1.0-beta.116 89 12/30/2024
9.1.0-beta.114 98 12/30/2024
9.1.0-beta.113 114 12/30/2024
9.1.0-beta.112 115 12/18/2024
9.1.0-beta.110 121 12/16/2024
9.1.0-beta.109 118 12/12/2024
9.0.1-beta.108 102 12/12/2024
9.0.1-beta.107 103 12/11/2024
9.0.1-beta.106 93 12/12/2024
9.0.1-beta.104 103 12/11/2024
9.0.1-beta.102 83 12/6/2024
9.0.1-beta.99 108 12/6/2024
9.0.1-beta.98 84 12/6/2024
9.0.1-beta.95 84 12/5/2024
9.0.1-beta.94 105 12/5/2024
9.0.1-beta.93 99 12/2/2024
9.0.1-beta.92 110 11/30/2024
9.0.1-beta.91 104 11/30/2024
9.0.1-beta.90 113 11/29/2024
9.0.1-beta.89 115 11/29/2024
9.0.1-beta.88 99 11/27/2024
9.0.1-beta.87 105 11/27/2024
9.0.1-beta.86 113 11/27/2024
9.0.1-beta.84 110 11/24/2024
9.0.1-beta.83 107 11/22/2024
9.0.1-beta.82 127 11/21/2024
9.0.1-beta.81 101 11/19/2024
9.0.1-beta.80 74 11/19/2024
9.0.1-beta.79 105 11/19/2024
9.0.1-beta.77 115 11/15/2024
9.0.0 223 11/15/2024
9.0.0-beta.76 111 11/14/2024
9.0.0-beta.75 102 11/14/2024
9.0.0-beta.74 92 11/14/2024
9.0.0-beta.73 83 11/14/2024
9.0.0-beta.72 101 11/14/2024
9.0.0-beta.71 107 11/13/2024
9.0.0-beta.70 117 11/13/2024
9.0.0-beta.69 105 11/13/2024
9.0.0-beta.68 113 11/13/2024
9.0.0-beta.67 114 11/13/2024
9.0.0-beta.66 82 11/13/2024
9.0.0-beta.63 110 11/12/2024
9.0.0-beta.54 102 10/31/2024
9.0.0-beta.53 84 10/29/2024
8.3.0 193 10/29/2024
8.3.0-beta.51 110 10/29/2024
8.3.0-beta.50 88 10/28/2024
8.3.0-beta.49 116 10/28/2024
8.3.0-beta.48 79 10/28/2024
8.3.0-beta.47 115 10/28/2024
8.3.0-beta.46 107 10/27/2024
8.3.0-beta.45 113 10/25/2024
8.3.0-beta.44 115 10/25/2024
8.3.0-beta.43 108 10/25/2024
8.3.0-beta.42 115 10/24/2024
8.2.1 190 10/23/2024
8.2.1-beta.40 76 10/23/2024
8.2.1-beta.39 85 10/23/2024
8.2.1-beta.38 118 10/23/2024
8.2.1-beta.37 106 10/23/2024
8.2.1-beta.36 113 10/23/2024
8.2.1-beta.35 108 10/23/2024
8.2.0-beta.34 90 10/23/2024
8.2.0-beta.33 107 10/23/2024
8.2.0-beta.32 114 10/22/2024
1.0.0-beta.60 115 11/11/2024
1.0.0-beta.58 105 11/4/2024
1.0.0-beta.57 91 11/1/2024
1.0.0-beta.56 109 11/1/2024
1.0.0-beta.55 112 11/1/2024