DistributedApplicationBuilder
Class net10.0
A builder for creating instances of
DistributedApplication. namespace Aspire.Hosting;
public class DistributedApplicationBuilder : Aspire.Hosting.IDistributedApplicationBuilder{ // ...} 17 members
Remarks
Section titled Remarks The DistributedApplicationBuilder is the primary implementation of IDistributedApplicationBuilder within .NET Aspire. Typically a developer would interact with instances of this class via the IDistributedApplicationBuilder interface which was created using one of the DistributedApplication.CreateBuilder overloads.
For more information on how to configure the DistributedApplication using the the builder pattern see IDistributedApplicationBuilder.
Constructors2
Section titled ConstructorsDistributedApplicationBuilder(string[]) Initializes a new instance of the
DistributedApplicationBuilder class with the specified options. DistributedApplicationBuilder(DistributedApplicationOptions) Initializes a new instance of the
DistributedApplicationBuilder class with the specified options. Properties12
Section titled PropertiesAppHostAssemblygetAssembly? Assembly of the app host project.
AppHostDirectorygetstring Directory of the project where the app host is located. Defaults to the content root if there's no project.
AppHostPathgetstringConfigurationgetConfigurationManager Gets the set of key/value configuration properties.
EnvironmentgetIHostEnvironment Gets the information about the hosting environment an application is running in.
Eventingget Eventing infrastructure for AppHost lifecycle.
ExecutionContextget Execution context for this invocation of the AppHost.
FileSystemServiceget Gets the service for managing Aspire file system operations.
Pipelineget Gets the deployment pipeline for this distributed application.
Resourcesget Gets the collection of resources for the distributed application.
ServicesgetIServiceCollection Gets a collection of services for the application to compose. This is useful for adding user provided or framework provided services.
UserSecretsManagerget Gets the service for managing user secrets.
Methods3
Section titled MethodsAddResource(T) Adds a resource of type
T to the distributed application. Build Builds and returns a new
DistributedApplication instance. This can only be called once. CreateResourceBuilder(T) Creates a new resource builder based on an existing resource.