Skip to content
Docs Try Aspire

DistributedApplicationBuilder Constructors

Class Constructors 2 members
A builder for creating instances of DistributedApplication.
Initializes a new instance of the DistributedApplicationBuilder class with the specified options.
public class DistributedApplicationBuilder
{
public DistributedApplicationBuilder(
string[] args)
{
// ...
}
}
args string[] The arguments provided to the builder.

Developers will not typically construct an instance of the DistributedApplicationBuilder class themselves and will instead use the DistributedApplication.CreateBuilder. This constructor is public to allow for some testing around extensibility scenarios.

Constructor(DistributedApplicationOptions) Section titled Constructor(DistributedApplicationOptions)
Initializes a new instance of the DistributedApplicationBuilder class with the specified options.
public class DistributedApplicationBuilder
{
public DistributedApplicationBuilder(
DistributedApplicationOptions options)
{
// ...
}
}
options DistributedApplicationOptions The options for the distributed application.

Developers will not typically construct an instance of the DistributedApplicationBuilder class themselves and will instead use the DistributedApplication.CreateBuilder. This constructor is public to allow for some testing around extensibility scenarios.

This constructor generates an instance of the IDistributedApplicationBuilder interface which is very similar to the instance that is returned from DistributedApplication.CreateBuilder however it is not guaranteed to be 100% consistent. For typical usage it is recommended that the DistributedApplication.CreateBuilder method is to create instances of the IDistributedApplicationBuilder interface.