string[] PassThroughArgs { get; }
Source
Gets the command-line arguments to pass through to the Aspire host.
Provides context and helper methods during the Aspire application startup process.
IResourceBuilder<TResource> Resolve<TResource>(IAspireComponent<TResource> dependency)
Source
Resolves an Aspire resource from a component, ensuring each component is only generated once.
TResourceThe type of the resource.dependencyThe component providing the resource.A resource builder for the resolved resource.
string GetPathFromRoot(string relativePath)
Source
Computes an absolute path from a path relative to the application root.
relativePathThe relative path.The computed absolute path.
Indicates that the implementing class is an Aspire component that can generate resources for the application. Classes implementing this interface are responsible for generating resources of type T,
TThe type of resource the component generates.IResourceBuilder<T> Generate(AspireStartupContext context, IDistributedApplicationBuilder appBuilder)
Source
Generates and adds a resource to the Aspire distributed application builder.
contextThe Aspire startup context.appBuilderThe distributed application builder.A resource builder for the generated resource.
The base interface for Aspire components. For now this interface does not define any members, but it serves as a marker interface to identify classes that are Aspire components. This allows for future expansion and additional functionality to be added to all Aspire components if needed.
A base class for defining an Aspire profile as a CLI command.
IEnumerable<AspireProfile> GetDependencies()
Source
Gets the dependencies (other profiles) that this profile requires.
An enumerable of dependent profiles.
IEnumerable<IAspireComponent> GetComponents()
Source
Gets the Aspire components that compose this profile.
An enumerable of Aspire components.
string[] PassThroughArgs { get; }
Source
Gets the command-line arguments to pass through to the Aspire host.
Entry point for running an Aspire application with no specific root module.
Use AspireApp.RunAsync(string[]) when the AppHost should use the framework-default NoHostModule and discover Aspire components from the calling assembly. If the caller has a concrete root module type that should participate in compile-time dependency and configuration registration, prefer AspireApp{TModule}.RunAsync(string[]) instead.
Task RunAsync(string[] args)
Source
Runs the Aspire application asynchronously.
argsCommand-line arguments.A task representing the run operation.
Entry point for running an Aspire application with a specific root module.
TModuleThe type of the root module.Use AspireApp{TModule}.RunAsync(string[]) when the root module is known at compile time and should participate in AppSurface dependency discovery, configuration registration, and host hooks. The new() constraint means TModule is activated by parameterless constructor rather than dependency injection, so keep constructors cheap, deterministic, and free of external side effects. Use AspireApp.RunAsync(string[]) when no root module is needed or module selection is driven by framework defaults. The call delegates to AspireAppStartup{TModule} for host activation.
Task RunAsync(string[] args)
Source
Runs the Aspire application asynchronously with the specified root module.
argsCommand-line arguments.A task representing the run operation.
Starts an Aspire AppHost with an AppSurface root module that implements IAppSurfaceHostModule.
TModuleThe root AppSurface host module type for the Aspire AppHost.AspireAppStartup{TModule} is the Aspire-specific bootstrapper behind AspireApp{TModule}.RunAsync(string[]). The new() constraint activates the root module with a parameterless constructor before dependency injection is available, so module constructors should avoid service resolution, blocking work, and disposable ownership. Host-module service registrations run through ConsoleStartup{TModule} before ConfigureAdditionalServices discovers Aspire components.
void ConfigureAdditionalServices(StartupContext context, IServiceCollection services)
Source
Discovers IAspireComponent types from the entry assembly and registers each concrete type as a singleton.
contextThe AppSurface startup context that supplies the entry assembly to scan.servicesThe service collection receiving discovered Aspire component registrations.ConfigureAdditionalServices runs after the root IAppSurfaceHostModule and dependency modules have registered services. Components are registered by concrete type only, not by implemented interfaces, so consumers should resolve concrete component types directly. The registration is startup-only and does not transfer disposal ownership beyond normal container ownership.