Corfedo.Troupe.Aspire.Hosting 0.4.0

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

Corfedo.Troupe.Aspire.Hosting

Runs Corfedo Troupe profiles and roles as Aspire project resources. Reference it from the AppHost project only; the application keeps referencing Corfedo.Troupe.

dotnet add package Corfedo.Troupe.Aspire.Hosting
var gateway = builder.AddTroupeProject<Projects.Operations>("gateway").WithTroupeProfile("gateway");
var api = builder.AddTroupeProject<Projects.Operations>("api")
    .WithTroupeProfile("api")
    .WithEnvironment("Roles__Remote__gateway", gateway.GetEndpoint("internal"));

// An application that selects through its own command line:
builder.AddTroupeProject<Projects.Host>("host-api").WithArgs("serve", "--profile", "api");

AddTroupeProject adds the project without its launch profile and Kestrel-derived endpoints, because Kestrel serves only the listeners the composition requests. WithTroupeProfile and WithTroupeRoles set the Profile or Roles environment variable. Before any resource starts, each project describes the composition it would serve with the resource's arguments and environment (Troupe's describe mode, about half a second per project). Then the package:

  • adds an HTTP endpoint for each listener the project requests, unless the AppHost declares an endpoint with that name, and sets Kestrel__Endpoints__<name>__Url to the endpoint's target port;
  • fails the AppHost once, before any resource starts, with the errors AddTroupe reports for every resource;
  • shows each resource's profile, roles and listeners on the dashboard, and the roles of the project that no resource runs.
Troupe resources cannot start:
  api: needs Roles__Remote__ai (read by ApiCalls because AiHost is not in this process).
       AiHost runs in "ai" (listeners: internal).
  ops-bad: TRP013: Unknown profile gatewy. Declared profiles: combined, api, gateway, ai, api-gateway.

The project must be built and must call AddTroupe from a Corfedo.Troupe version with describe mode. See the Aspire guide.

Product Compatible and additional computed target framework versions.
.NET 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
0.4.0 94 11/20/2026
0.3.0 91 11/11/2026