Corfedo.Troupe.AspNetCore
0.4.0
Prefix Reserved
dotnet add package Corfedo.Troupe.AspNetCore --version 0.4.0
NuGet\Install-Package Corfedo.Troupe.AspNetCore -Version 0.4.0
<PackageReference Include="Corfedo.Troupe.AspNetCore" Version="0.4.0" />
<PackageVersion Include="Corfedo.Troupe.AspNetCore" Version="0.4.0" />
<PackageReference Include="Corfedo.Troupe.AspNetCore" />
paket add Corfedo.Troupe.AspNetCore --version 0.4.0
#r "nuget: Corfedo.Troupe.AspNetCore, 0.4.0"
#:package Corfedo.Troupe.AspNetCore@0.4.0
#addin nuget:?package=Corfedo.Troupe.AspNetCore&version=0.4.0
#tool nuget:?package=Corfedo.Troupe.AspNetCore&version=0.4.0
Corfedo Troupe
Compose a .NET host from components that declare what they need, and catch a misconfigured host before it
serves a request. As an application grows, one Program.cs wires every project into the host, projects reference
each other only because that code needs them, and each new component is wired the way the nearest example was.
Troupe gives every part of the host the same shape: a component declares the services it registers, the
configuration it reads and the components it requires. Troupe records the owner of every registration and stops
startup with a diagnostic that names the owners. When the application later runs as several processes, roles select
components from the same declarations.
dotnet add package Corfedo.Troupe
dotnet add package Corfedo.Troupe.AspNetCore # middleware stages, endpoints and Kestrel endpoints
dotnet add package Corfedo.Troupe.Testing # composition verification and test overrides
The definition requires a component, and the component owns its configuration section:
public sealed class WorkerComposition : ICompositionDefinition
{
public void Define(ICompositionDefinitionBuilder definition) => definition.Requires<HeartbeatComponent>();
}
public sealed class HeartbeatComponent : IComponent
{
public void Compose(IComponentBuilder component)
{
component.Options<HeartbeatOptions>("Worker", (section, options) => section.Bind(options));
component.Services(services => services.AddHostedService<HeartbeatService>());
}
}
var builder = Host.CreateApplicationBuilder(args);
builder.AddTroupe<WorkerComposition>();
using var host = builder.Build();
await host.RunAsync();
Without a Worker section, AddTroupe throws a CompositionException with TRP005, naming HeartbeatComponent and the
section, and the host never starts.
The packages depend on each other's exact version, so update them together. See the documentation for a first application, splitting into processes, guides and examples.
Troupe is licensed under Apache-2.0. Corfedo names, logos and brand assets are reserved; see the NOTICE file.
| Product | Versions 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. |
-
net10.0
- Corfedo.Troupe (= 0.4.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Corfedo.Troupe.AspNetCore:
| Package | Downloads |
|---|---|
|
Corfedo.Troupe.Testing
Testing support for Corfedo Troupe: verify every declared profile with real hosts, compose a slice of components and replace services with recorded test ownership. |
GitHub repositories
This package is not used by any popular GitHub repositories.