Core abstractions for the Aspire application model.
$ dotnet add package Aspire.HostingCore abstractions for the .NET Aspire application model. It provides the building blocks for the distributed application
hosting model. This package should not be referenced by AppHost projects directly. Instead use the Aspire.Hosting.AppHost
package to add a transitive referencing including custom build targets to support code generation of metadata
types for referenced .NET projects.
Developers wishing to build their own custom resource types and supporting APIs for .NET Aspire should reference this package directly.
Aspire models distributed applications as a graph of resources—services, infrastructure elements, and supporting components—using strongly-typed, extensible abstractions. Resources are inert data objects that describe capabilities, configuration, and relationships. Developers compose applications using fluent extension methods (like AddProject, AddPostgres, etc.), wire dependencies explicitly, and attach metadata through annotations to drive orchestration, configuration, and deployment.
Key concepts include:
AddX, WithReference, and WithEnvironment that guide correct resource composition and wiring.Aspire's approach ensures flexibility, strong tooling support, and clear separation between modeling, orchestration, and execution of distributed .NET applications.
For the full details and specification, see the App Model document.