編輯

共用方式為


.NET Aspire Go hosting

Includes: Hosting integration not Client integration

Note

This integration is part of the .NET Aspire Community Toolkit and isn't officially supported by the .NET Aspire team.

In this article, you learn how to use the .NET Aspire Go hosting integration to host Go applications.

Hosting integration

To get started with the .NET Aspire Go hosting integration, install the 📦 Aspire.CommunityToolkit.Hosting.Go NuGet package in the AppHost project.

dotnet add package Aspire.CommunityToolkit.Hosting.Golang

For more information, see dotnet add package or Manage package dependencies in .NET applications.

Example usage

In the Program.cs file of your app host project, call the AddGolangApp method to add a Go application to the builder.

var golang = builder.AddGolangApp("golang", "../go-service");

The Go application can be added as a reference to other resources in the AppHost project.

See also