RazorDocs Search

Aspire

ForgeTrust.Runnable.Aspire

.NET Aspire integration for the Runnable ecosystem.

Overview

ForgeTrust.Runnable.Aspire provides a modular way to define distributed applications using .NET Aspire. It allows you to encapsulate service defaults and resource registrations into modules.

Usage

Use AspireApp to start your Aspire AppHost:

await AspireApp<MyHostModule>.RunAsync(args);

📂 Back to Aspire List | 🏠 Back to Root

Type

AspireApp

Entry point for running an Aspire application with no specific root module.

Method

RunAsync

Task RunAsync(string[] args)

Runs the Aspire application asynchronously.

Parameters

  • argsCommand-line arguments.

Returns

A task representing the run operation.

Type

AspireApp<TModule>

Entry point for running an Aspire application with a specific root module.

Type Parameters

  • TModuleThe type of the root module.
Method

RunAsync

Task RunAsync(string[] args)

Runs the Aspire application asynchronously with the specified root module.

Parameters

  • argsCommand-line arguments.

Returns

A task representing the run operation.

Type

AspireProfile

A base class for defining an Aspire profile as a CLI command.

Method

GetDependencies

IEnumerable<AspireProfile> GetDependencies()

Gets the dependencies (other profiles) that this profile requires.

Returns

An enumerable of dependent profiles.

Method

GetComponents

IEnumerable<IAspireComponent> GetComponents()

Gets the Aspire components that compose this profile.

Returns

An enumerable of Aspire components.

Property

PassThroughArgs

string[] PassThroughArgs { get; }

Gets the command-line arguments to pass through to the Aspire host.

Type

IAspireComponent<T>

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,

Type Parameters

  • TThe type of resource the component generates.
Method

Generate

IResourceBuilder<T> Generate(AspireStartupContext context, IDistributedApplicationBuilder appBuilder)

Generates and adds a resource to the Aspire distributed application builder.

Parameters

  • contextThe Aspire startup context.
  • appBuilderThe distributed application builder.

Returns

A resource builder for the generated resource.

Type

IAspireComponent

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.

Type

AspireStartupContext

Provides context and helper methods during the Aspire application startup process.

Method

Resolve

IResourceBuilder<TResource> Resolve<TResource>(IAspireComponent<TResource> dependency)

Resolves an Aspire resource from a component, ensuring each component is only generated once.

Type Parameters

  • TResourceThe type of the resource.

Parameters

  • dependencyThe component providing the resource.

Returns

A resource builder for the resolved resource.

Method

GetPathFromRoot

string GetPathFromRoot(string relativePath)

Computes an absolute path from a path relative to the application root.

Parameters

  • relativePathThe relative path.

Returns

The computed absolute path.