# IExecutionConfigurationBuilder Methods

- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Type: [IExecutionConfigurationBuilder](/reference/api/csharp/aspire.hosting/iexecutionconfigurationbuilder.md)
- Kind: `Methods`
- Members: `2`

Builder for gathering and resolving the execution configuration (arguments and environment variables) for a specific resource.

## AddExecutionConfigurationGatherer(IExecutionConfigurationGatherer)

- Name: `AddExecutionConfigurationGatherer(IExecutionConfigurationGatherer)`
- Modifiers: `abstract`
- Returns: [IExecutionConfigurationBuilder](/reference/api/csharp/aspire.hosting/iexecutionconfigurationbuilder.md)

Adds a configuration gatherer to the builder.

```csharp
public interface IExecutionConfigurationBuilder
{
    public abstract IExecutionConfigurationBuilder AddExecutionConfigurationGatherer(
        IExecutionConfigurationGatherer gatherer)
    {
        // ...
    }
}
```

## Parameters

- `gatherer` ([IExecutionConfigurationGatherer](/reference/api/csharp/aspire.hosting/iexecutionconfigurationgatherer.md))
  The configuration gatherer to add.

## Returns

[IExecutionConfigurationBuilder](/reference/api/csharp/aspire.hosting/iexecutionconfigurationbuilder.md) -- The current instance of the builder.

## BuildAsync(DistributedApplicationExecutionContext, ILogger?, CancellationToken)

- Name: `BuildAsync(DistributedApplicationExecutionContext, ILogger?, CancellationToken)`
- Modifiers: `abstract`
- Returns: [Task<IExecutionConfigurationResult>](/reference/api/csharp/aspire.hosting/iexecutionconfigurationresult.md)

Builds the processed resource configuration (resolved arguments and environment variables).

```csharp
public interface IExecutionConfigurationBuilder
{
    public abstract Task<IExecutionConfigurationResult> BuildAsync(
        DistributedApplicationExecutionContext executionContext,
        ILogger? resourceLogger = null,
        CancellationToken cancellationToken = default(CancellationToken))
    {
        // ...
    }
}
```

## Parameters

- `executionContext` ([DistributedApplicationExecutionContext](/reference/api/csharp/aspire.hosting/distributedapplicationexecutioncontext.md))
  The distributed application execution context.
- `resourceLogger` (`ILogger?`) `optional`
  A logger instance for the resource. If none is provided, a default logger will be used.
- `cancellationToken` (`CancellationToken`) `optional`
  A cancellation token.

## Returns

[Task<IExecutionConfigurationResult>](/reference/api/csharp/aspire.hosting/iexecutionconfigurationresult.md) -- The resource configuration result. Any exceptions that occurred while processing are available via the [IExecutionConfigurationResult.Exception](/reference/api/csharp/aspire.hosting/iexecutionconfigurationresult/properties.md#exception) property.
