# IDistributedApplicationTestingBuilder

- Kind: `interface`
- Package: [Aspire.Hosting.Testing](/reference/api/csharp/aspire.hosting.testing.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.Testing`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Testing/DistributedApplicationTestingBuilder.cs)
- Implements: `IDistributedApplicationBuilder`, `IAsyncDisposable`, `IDisposable`

A builder for creating instances of `Hosting.DistributedApplication` for testing purposes.

## Definition

```csharp
namespace Aspire.Hosting.Testing;

public interface IDistributedApplicationTestingBuilder
    : Aspire.Hosting.IDistributedApplicationBuilder,
      System.IAsyncDisposable,
      System.IDisposable
{
    // ...
}
```

## Properties

- [AppHostAssembly](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#apphostassembly) : `Assembly?` `virtual` `get` -- Assembly of the app host project.
- [AppHostDirectory](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#apphostdirectory) : `string` `virtual` `get` -- Directory of the project where the app host is located. Defaults to the content root if there's no project.
- [Configuration](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#configuration) : `ConfigurationManager` `virtual` `get` -- Gets the set of key/value configuration properties.
- [Environment](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#environment) : `IHostEnvironment` `virtual` `get` -- Gets the information about the hosting environment an application is running in.
- [Eventing](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#eventing) : `IDistributedApplicationEventing` `virtual` `get` -- Eventing infrastructure for AppHost lifecycle.
- [ExecutionContext](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#executioncontext) : `DistributedApplicationExecutionContext` `virtual` `get` -- Execution context for this invocation of the AppHost.
- [FileSystemService](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#filesystemservice) : `IFileSystemService` `virtual` `get`
- [Pipeline](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#pipeline) : `IDistributedApplicationPipeline` `virtual` `get`
- [Resources](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#resources) : `IResourceCollection` `virtual` `get` -- Gets the collection of resources for the distributed application.
- [Services](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#services) : `IServiceCollection` `virtual` `get` -- Gets a collection of services for the application to compose. This is useful for adding user provided or framework provided services.
- [UserSecretsManager](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/properties.md#usersecretsmanager) : `IUserSecretsManager` `virtual` `get`

## Methods

- [AddResource(T)](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/methods.md#addresource-t) : `IResourceBuilder<T>` `virtual`
- [BuildAsync(CancellationToken)](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/methods.md#buildasync-cancellationtoken) : `Task<DistributedApplication>` `abstract` -- Builds and returns a new `Hosting.DistributedApplication` instance. This can only be called once.
- [CreateResourceBuilder(T)](/reference/api/csharp/aspire.hosting.testing/idistributedapplicationtestingbuilder/methods.md#createresourcebuilder-t) : `IResourceBuilder<T>` `virtual`
