1 instantiation of DistributedApplication
Aspire.Hosting (1)
DistributedApplicationBuilder.cs (1)
414var application = new DistributedApplication(_innerBuilder.Build());
671 references to DistributedApplication
Aspire.Hosting (44)
Dashboard\DashboardLifecycleHook.cs (1)
27ILogger<DistributedApplication> distributedApplicationLogger,
Dcp\ApplicationExecutor.cs (1)
70ILogger<DistributedApplication> distributedApplicationLogger,
DistributedApplication.cs (21)
18/// The <see cref="DistributedApplication"/> is an implementation of the <see cref="IHost"/> interface that orchestrates 19/// a .NET Aspire application. To build an instance of the <see cref="DistributedApplication"/> class, use the 20/// <see cref="DistributedApplication.CreateBuilder()"/> method to create an instance of the <see cref="IDistributedApplicationBuilder"/> 26/// to create an instance of the <see cref="DistributedApplication"/> class. The <see cref="DistributedApplication"/> class 27/// exposes a <see cref="DistributedApplication.Run"/> method which then starts the distributed application and its 54/// Initializes a new instance of the <see cref="DistributedApplication"/> class. 96/// The <see cref="DistributedApplication.CreateBuilder(string[])"/> method is the most common way to 152/// The <see cref="DistributedApplication.CreateBuilder(DistributedApplicationOptions)"/> method provides 195/// The <see cref="DistributedApplication"/> is an <see cref="IHost"/> implementation and as such 197/// dependency injection container after <see cref="DistributedApplication" /> instance has been 212/// Typically developers do not need to worry about calling the Dispose method on the <see cref="DistributedApplication"/> 217/// If you are using the <see cref="DistributedApplication"/> and <see cref="IDistributedApplicationBuilder"/> inside 218/// unit test code then you should correctly dispose of the <see cref="DistributedApplication"/> instance. This is 223/// Without disposing of the <see cref="DistributedApplication"/> 244/// Typically developers do not need to worry about calling the Dispose method on the <see cref="DistributedApplication"/> 249/// If you are using the <see cref="DistributedApplication"/> and <see cref="IDistributedApplicationBuilder"/> inside 250/// unit test code then you should correctly dispose of the <see cref="DistributedApplication"/> instance. This is 255/// Without disposing of the <see cref="DistributedApplication"/> 291/// When the .NET Aspire app host is launched via <see cref="DistributedApplication.RunAsync"/> there are 320/// When the .NET Aspire app host is launched via <see cref="DistributedApplication.RunAsync"/> there are
DistributedApplicationBuilder.cs (10)
28/// A builder for creating instances of <see cref="DistributedApplication"/>. 35/// interface which was created using one of the <see cref="DistributedApplication.CreateBuilder(string[])"/> 39/// For more information on how to configure the <see cref="DistributedApplication" /> using the 89/// class themselves and will instead use the <see cref="DistributedApplication.CreateBuilder(string[])"/>. 110/// class themselves and will instead use the <see cref="DistributedApplication.CreateBuilder(string[])"/>. 115/// which is very similar to the instance that is returned from <see cref="DistributedApplication.CreateBuilder(string[])"/> 117/// <see cref="DistributedApplication.CreateBuilder(string[])"/> method is to create instances of 398public DistributedApplication Build() 414var application = new DistributedApplication(_innerBuilder.Build()); 486private static DiagnosticListener LogAppBuilt(DistributedApplication app)
DistributedApplicationLifecycle.cs (1)
12ILogger<DistributedApplication> logger,
DistributedApplicationOptions.cs (1)
9/// Options for configuring the behavior of <see cref="DistributedApplication.CreateBuilder(DistributedApplicationOptions)"/>.
IDistributedApplicationBuilder.cs (9)
15/// A builder for creating instances of <see cref="DistributedApplication"/>. 20/// the resources which are orchestrated by the <see cref="DistributedApplication"/> when 25/// developers should use the <see cref="DistributedApplication.CreateBuilder(string[])"/> 33/// a Redis cache and a PostgreSQL database. The builder is created using the <see cref="DistributedApplication.CreateBuilder(string[])"/> 214/// Builds and returns a new <see cref="DistributedApplication"/> instance. This can only be called once. 216/// <returns>A new <see cref="DistributedApplication"/> instance.</returns> 220/// <see cref="DistributedApplication"/> instance that is returned. Note that the <see cref="DistributedApplication"/> 226DistributedApplication Build();
Aspire.Hosting.Analyzers.Tests (1)
AnalyzerTest.cs (1)
42TrimAssemblyExtension(typeof(DistributedApplication).Assembly.Location)
Aspire.Hosting.Azure.Tests (39)
AzureBicepResourceTests.cs (1)
87var app = builder.Build();
AzureContainerAppsTests.cs (21)
29using var app = builder.Build(); 125using var app = builder.Build(); 229using var app = builder.Build(); 374using var app = builder.Build(); 514using var app = builder.Build(); 769using var app = builder.Build(); 867using var app = builder.Build(); 979using var app = builder.Build(); 1130using var app = builder.Build(); 1288using var app = builder.Build(); 1377using var app = builder.Build(); 1475using var app = builder.Build(); 1580using var app = builder.Build(); 1678using var app = builder.Build(); 1814using var app = builder.Build(); 1835using var app = builder.Build(); 1854using var app = builder.Build(); 1874using var app = builder.Build(); 1893using var app = builder.Build(); 1912using var app = builder.Build(); 1922private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
AzureCosmosDBEmulatorFunctionalTests.cs (4)
42using var app = builder.Build(); 88using var app = builder.Build(); 158using (var app = builder1.Build()) 204using (var app = builder2.Build())
AzureEventHubsExtensionsTests.cs (2)
43using var app = builder.Build(); 74using var app = builder.Build();
AzureFunctionsTests.cs (2)
120using var host = builder.Build(); 141using var host = builder.Build();
AzureResourceOptionsTests.cs (1)
41using var app = builder.Build();
AzureServiceBusExtensionsTests.cs (6)
206using var app = builder.Build(); 238using var app = builder.Build(); 370using var app = builder.Build(); 467using var app = builder.Build(); 562using var app = builder.Build(); 609using var app = builder.Build();
AzureStorageEmulatorFunctionalTests.cs (2)
44using var app = builder.Build(); 74using var app = builder.Build();
Aspire.Hosting.Containers.Tests (24)
ContainerResourceTests.cs (13)
17var appBuilder = DistributedApplication.CreateBuilder(); 20using var app = appBuilder.Build(); 36var appBuilder = DistributedApplication.CreateBuilder(); 39using var app = appBuilder.Build(); 55var appBuilder = DistributedApplication.CreateBuilder(); 74using var app = appBuilder.Build(); 104var builder = DistributedApplication.CreateBuilder(["--publisher", "manifest"]); 137var builder = DistributedApplication.CreateBuilder(["--publisher", "manifest"]); 166var appBuilder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions { ProjectDirectory = basePath }); 171using var app = appBuilder.Build(); 183var builder = DistributedApplication.CreateBuilder(["--publisher", "manifest"]); 227var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 239using var app = builder.Build();
WithDockerfileTests.cs (11)
36using var app = builder.Build(); 67using var app = builder.Build(); 100using var app = builder.Build(); 133using var app = builder.Build(); 158var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 206var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 253var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 299var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 360using var app = builder.Build(); 430using var app = builder.Build(); 754private static async Task WaitForResourceAsync(DistributedApplication app, string resourceName, string resourceState, TimeSpan? timeout = null)
Aspire.Hosting.Dapr.Tests (3)
DaprTests.cs (3)
34using var app = builder.Build(); 134using var app = builder.Build(); 173private static extern Task ExecuteBeforeStartHooksAsync(DistributedApplication app, CancellationToken cancellationToken);
Aspire.Hosting.Elasticsearch.Tests (10)
AddElasticsearchTests.cs (6)
18var appBuilder = DistributedApplication.CreateBuilder(); 22using var app = appBuilder.Build(); 78var appBuilder = DistributedApplication.CreateBuilder(); 84using var app = appBuilder.Build(); 140var appBuilder = DistributedApplication.CreateBuilder(); 145using var app = appBuilder.Build();
ElasticsearchFunctionalTests.cs (4)
41using var app = builder.Build(); 102using (var app = builder1.Build()) 147using (var app = builder2.Build()) 225using var app = builder.Build();
Aspire.Hosting.Garnet.Tests (10)
AddGarnetTests.cs (6)
17var appBuilder = DistributedApplication.CreateBuilder(); 20using var app = appBuilder.Build(); 45var appBuilder = DistributedApplication.CreateBuilder(); 48using var app = appBuilder.Build(); 73var appBuilder = DistributedApplication.CreateBuilder(); 77await using var app = appBuilder.Build();
GarnetFunctionalTests.cs (4)
38using var app = builder.Build(); 72using var app = builder.Build(); 150using (var app = builder1.Build()) 201using (var app = builder2.Build())
Aspire.Hosting.Kafka.Tests (9)
AddKafkaTests.cs (4)
17var appBuilder = DistributedApplication.CreateBuilder(); 21using var app = appBuilder.Build(); 58var appBuilder = DistributedApplication.CreateBuilder(); 63using var app = appBuilder.Build();
KafkaFunctionalTests.cs (4)
39using var app = builder.Build(); 70using var app = builder.Build(); 160using (var app = builder1.Build()) 212using (var app = builder2.Build())
KafkaPublicApiTests.cs (1)
27var builder = DistributedApplication.CreateBuilder([]);
Aspire.Hosting.Keycloak.Tests (2)
KeycloakResourceBuilderTests.cs (2)
17var appBuilder = DistributedApplication.CreateBuilder(); 22using var app = appBuilder.Build();
Aspire.Hosting.Milvus.Tests (16)
AddMilvusTests.cs (8)
19var appBuilder = DistributedApplication.CreateBuilder(); 25using var app = appBuilder.Build(); 50var appBuilder = DistributedApplication.CreateBuilder(); 56using var app = appBuilder.Build(); 81var appBuilder = DistributedApplication.CreateBuilder(); 98var appBuilder = DistributedApplication.CreateBuilder(); 132var appBuilder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions() { Args = new string[] { "--publisher", "manifest" } }); 189using var app = builder.Build();
MilvusFunctionalTests.cs (3)
28using var app = builder.Build(); 100using (var app = builder1.Build()) 148using (var app = builder2.Build())
MilvusPublicApiTests.cs (5)
27var builder = DistributedApplication.CreateBuilder([]); 41var builder = DistributedApplication.CreateBuilder([]); 103var builder = DistributedApplication.CreateBuilder([]); 130var builder = DistributedApplication.CreateBuilder([]); 145var builder = DistributedApplication.CreateBuilder([]);
Aspire.Hosting.MongoDB.Tests (15)
AddMongoDBTests.cs (9)
18var appBuilder = DistributedApplication.CreateBuilder(); 22using var app = appBuilder.Build(); 47var appBuilder = DistributedApplication.CreateBuilder(); 50using var app = appBuilder.Build(); 75var appBuilder = DistributedApplication.CreateBuilder(); 81using var app = appBuilder.Build(); 110var builder = DistributedApplication.CreateBuilder(); 128var builder = DistributedApplication.CreateBuilder(); 192var appBuilder = DistributedApplication.CreateBuilder();
MongoDbFunctionalTests.cs (5)
50using var app = builder.Build(); 83using var app = builder.Build(); 142using (var app = builder1.Build()) 189using (var app = builder2.Build()) 311using var app = builder.Build();
MongoDBPublicApiTests.cs (1)
27var builder = DistributedApplication.CreateBuilder([]);
Aspire.Hosting.MySql.Tests (20)
AddMySqlTests.cs (12)
39var appBuilder = DistributedApplication.CreateBuilder(); 42using var app = appBuilder.Build(); 76var appBuilder = DistributedApplication.CreateBuilder(); 82using var app = appBuilder.Build(); 116var appBuilder = DistributedApplication.CreateBuilder(); 120using var app = appBuilder.Build(); 134var appBuilder = DistributedApplication.CreateBuilder(); 139using var app = appBuilder.Build(); 236var builder = DistributedApplication.CreateBuilder(); 238using var app = builder.Build(); 270var builder = DistributedApplication.CreateBuilder(); 281using var app = builder.Build();
MySqlFunctionalTests.cs (6)
46using var app = builder.Build(); 83using var app = builder.Build(); 154using (var app = builder1.Build()) 224using (var app = builder2.Build()) 332using var app = builder.Build(); 402using var app = builder.Build();
MySqlPublicApiTests.cs (2)
27var builder = DistributedApplication.CreateBuilder([]); 146var distributedApplicationBuilder = DistributedApplication.CreateBuilder([]);
Aspire.Hosting.Nats.Tests (14)
AddNatsTests.cs (8)
37var appBuilder = DistributedApplication.CreateBuilder(); 45using var app = appBuilder.Build(); 61var appBuilder = DistributedApplication.CreateBuilder(); 74using var app = appBuilder.Build(); 88var appBuilder = DistributedApplication.CreateBuilder(); 92using var app = appBuilder.Build(); 128var appBuilder = DistributedApplication.CreateBuilder(); 134using var app = appBuilder.Build();
NatsFunctionalTests.cs (6)
33using var app = builder.Build(); 78using var app = builder.Build(); 122using var app = builder.Build(); 183using (var app = builder1.Build()) 231using (var app = builder2.Build()) 341using var app = builder.Build();
Aspire.Hosting.NodeJs.Tests (7)
NodeAppFixture.cs (2)
20private DistributedApplication? _app; 23public DistributedApplication App => _app ?? throw new InvalidOperationException("DistributedApplication is not initialized.");
NodeJsPublicApiTests.cs (5)
26var builder = DistributedApplication.CreateBuilder(); 39var builder = DistributedApplication.CreateBuilder(); 65var builder = DistributedApplication.CreateBuilder(); 78var builder = DistributedApplication.CreateBuilder(); 91var builder = DistributedApplication.CreateBuilder();
Aspire.Hosting.Oracle.Tests (15)
AddOracleTests.cs (10)
38var appBuilder = DistributedApplication.CreateBuilder(); 41using var app = appBuilder.Build(); 75var appBuilder = DistributedApplication.CreateBuilder(); 81using var app = appBuilder.Build(); 115var appBuilder = DistributedApplication.CreateBuilder(); 119using var app = appBuilder.Build(); 134var appBuilder = DistributedApplication.CreateBuilder(); 139using var app = appBuilder.Build(); 157var appBuilder = DistributedApplication.CreateBuilder(); 163using var app = appBuilder.Build();
OracleFunctionalTests.cs (5)
44using var app = builder.Build(); 125using (var app = builder1.Build()) 186using (var app = builder2.Build()) 302using var app = builder.Build(); 369using var app = builder.Build();
Aspire.Hosting.PostgreSQL.Tests (24)
AddPostgresTests.cs (17)
20var builder = DistributedApplication.CreateBuilder(); 48var appBuilder = DistributedApplication.CreateBuilder(); 51using var app = appBuilder.Build(); 100var appBuilder = DistributedApplication.CreateBuilder(); 106using var app = appBuilder.Build(); 155var appBuilder = DistributedApplication.CreateBuilder(); 169var appBuilder = DistributedApplication.CreateBuilder(); 174using var app = appBuilder.Build(); 191var appBuilder = DistributedApplication.CreateBuilder(); 197using var app = appBuilder.Build(); 390var builder = DistributedApplication.CreateBuilder(); 400var builder = DistributedApplication.CreateBuilder(); 418var builder = DistributedApplication.CreateBuilder(); 454var builder = DistributedApplication.CreateBuilder(); 466using var app = builder.Build(); 499var builder = DistributedApplication.CreateBuilder(); 513using var app = builder.Build();
PostgresFunctionalTests.cs (7)
49using var app = builder.Build(); 86using var app = builder.Build(); 115using var app = builder.Build(); 163using var app = builder.Build(); 229using (var app = builder1.Build()) 291using (var app = builder2.Build()) 384using var app = builder.Build();
Aspire.Hosting.Python.Tests (4)
AddPythonAppTests.cs (4)
93using var app = builder.Build(); 139var app = builder.Build(); 175var app = builder.Build(); 214var app = builder.Build();
Aspire.Hosting.Qdrant.Tests (17)
AddQdrantTests.cs (11)
41var appBuilder = DistributedApplication.CreateBuilder(); 44using var app = appBuilder.Build(); 80var appBuilder = DistributedApplication.CreateBuilder(); 83using var app = appBuilder.Build(); 111var appBuilder = DistributedApplication.CreateBuilder(); 117using var app = appBuilder.Build(); 153var appBuilder = DistributedApplication.CreateBuilder(); 170var appBuilder = DistributedApplication.CreateBuilder(); 207var appBuilder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions() { Args = new string[] { "--publisher", "manifest" } } ); 243var appBuilder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions() { Args = new string[] { "--publisher", "manifest" } }); 285using var app = builder.Build();
QdrantFunctionalTests.cs (4)
38using var app = builder.Build(); 121using (var app = builder1.Build()) 166using (var app = builder2.Build()) 241using var app = builder.Build();
QdrantPublicApiTests.cs (2)
27var builder = DistributedApplication.CreateBuilder([]); 101var distributedApplicationBuilder = DistributedApplication.CreateBuilder([]);
Aspire.Hosting.RabbitMQ.Tests (11)
AddRabbitMQTests.cs (4)
49using var app = appBuilder.Build(); 94var appBuilder = DistributedApplication.CreateBuilder(); 102using var app = appBuilder.Build(); 136using var app = appBuilder.Build();
RabbitMQFunctionalTests.cs (4)
40using var app = builder.Build(); 69using var app = builder.Build(); 128using (var app = builder1.Build()) 185using (var app = builder2.Build())
RabbitMQPublicApiTests.cs (3)
27var builder = DistributedApplication.CreateBuilder([]); 97var distributedApplicationBuilder = DistributedApplication.CreateBuilder([]); 110var distributedApplicationBuilder = DistributedApplication.CreateBuilder([]);
Aspire.Hosting.Redis.Tests (31)
AddRedisTests.cs (17)
18var builder = DistributedApplication.CreateBuilder(); 26var appBuilder = DistributedApplication.CreateBuilder(); 29using var app = appBuilder.Build(); 54var appBuilder = DistributedApplication.CreateBuilder(); 57using var app = appBuilder.Build(); 82var appBuilder = DistributedApplication.CreateBuilder(); 86using var app = appBuilder.Build(); 125var builder = DistributedApplication.CreateBuilder(); 135var builder = DistributedApplication.CreateBuilder(); 145var builder = DistributedApplication.CreateBuilder(); 163var builder = DistributedApplication.CreateBuilder(); 181var builder = DistributedApplication.CreateBuilder(); 195var builder = DistributedApplication.CreateBuilder(); 209var builder = DistributedApplication.CreateBuilder(); 211using var app = builder.Build(); 231var builder = DistributedApplication.CreateBuilder(); 234using var app = builder.Build();
RedisFunctionalTests.cs (14)
44using var app = builder.Build(); 75using var app = builder.Build(); 97using var app = builder.Build(); 163using var app1 = builder1.Build(); 201using var app2 = builder2.Build(); 252using var app = builder.Build(); 307using (var app = builder1.Build()) 344using (var app = builder2.Build()) 393using (var app = builder1.Build()) 429using (var app = builder2.Build()) 477using (var app = builder1.Build()) 508using (var app = builder2.Build()) 572using (var app = builder1.Build()) 615using (var app = builder2.Build())
Aspire.Hosting.SqlServer.Tests (19)
AddSqlServerTests.cs (6)
38var appBuilder = DistributedApplication.CreateBuilder(); 42using var app = appBuilder.Build(); 82var appBuilder = DistributedApplication.CreateBuilder(); 90using var app = appBuilder.Build(); 104var appBuilder = DistributedApplication.CreateBuilder(); 113using var app = appBuilder.Build();
SqlServerFunctionalTests.cs (4)
40using var app = builder.Build(); 75using var app = builder.Build(); 175using var app1 = builder1.Build(); 258using (var app2 = builder2.Build())
SqlServerPublicApiTests.cs (9)
27var builder = DistributedApplication.CreateBuilder([]); 51var builder = DistributedApplication.CreateBuilder([]) 64var builder = DistributedApplication.CreateBuilder([]) 113var distributedApplicationBuilder = DistributedApplication.CreateBuilder([]); 127var distributedApplicationBuilder = DistributedApplication.CreateBuilder([]); 142var distributedApplicationBuilder = DistributedApplication.CreateBuilder([]); 157var distributedApplicationBuilder = DistributedApplication.CreateBuilder([]); 172var distributedApplicationBuilder = DistributedApplication.CreateBuilder([]); 187var distributedApplicationBuilder = DistributedApplication.CreateBuilder([]);
Aspire.Hosting.Testing (21)
DistributedApplicationEntryPointInvoker.cs (5)
18public static Func<string[], CancellationToken, Task<DistributedApplication>>? ResolveEntryPoint( 48private readonly TaskCompletionSource<DistributedApplication> _appTcs = new(); 72public async Task<DistributedApplication> InvokeAsync(CancellationToken cancellationToken) 101_appTcs.TrySetException(new InvalidOperationException($"The entry point exited without building a {nameof(DistributedApplication)}.")); 202owner._appTcs.TrySetResult((DistributedApplication)value.Value!);
DistributedApplicationFactory.cs (7)
26private readonly TaskCompletionSource<DistributedApplication> _appTcs = new(TaskCreationOptions.RunContinuationsAsynchronously); 51internal async Task<DistributedApplication> ResolveApplicationAsync(CancellationToken cancellationToken = default) 130protected virtual void OnBuilt(DistributedApplication application) 134private void OnBuiltCore(DistributedApplication application) 269$"Could not intercept application builder instance. Ensure that {_entryPoint} is a type in an executable assembly, that the entrypoint creates an {typeof(DistributedApplicationBuilder)}, and that the resulting {typeof(DistributedApplication)} is being started."); 279private async Task InvokeEntryPoint(Func<string[], CancellationToken, Task<DistributedApplication>> factory) 334private DistributedApplication GetStartedApplication()
DistributedApplicationHostingTestingExtensions.cs (7)
12/// Extensions for working with <see cref="DistributedApplication"/> in test code. 23public static HttpClient CreateHttpClient(this DistributedApplication app, string resourceName, string? endpointName = default) 41public static ValueTask<string?> GetConnectionStringAsync(this DistributedApplication app, string resourceName, CancellationToken cancellationToken = default) 61public static Uri GetEndpoint(this DistributedApplication app, string resourceName, string? endpointName = default) => new(GetEndpointUriStringCore(app, resourceName, endpointName)); 63static IResource GetResource(DistributedApplication app, string resourceName) 79static string GetEndpointUriStringCore(DistributedApplication app, string resourceName, string? endpointName = default) 105static void ThrowIfNotStarted(DistributedApplication app)
DistributedApplicationTestingBuilder.cs (2)
140public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken) 178public async Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken)
Aspire.Hosting.Testing.Tests (21)
DistributedApplicationFixtureOfT.cs (2)
31protected override void OnBuilt(DistributedApplication application) 37public DistributedApplication Application { get; private set; } = null!;
DistributedApplicationHttpClientExtensionsForTests.cs (1)
11public static HttpClient CreateHttpClientWithResilience(this DistributedApplication app, string resourceName, string? endpointName = default)
TestingBuilderTests.cs (7)
113await using var app = await appHost.BuildAsync(); 136await using var app = await appHost.BuildAsync(); 154await using var app = await appHost.BuildAsync(); 175await using var app = await appHost.BuildAsync(); 188await using var app = await appHost.BuildAsync(); 203await using var app = await appHost.BuildAsync(); 234DistributedApplication? app = null;
TestingFactoryTests.cs (1)
16private readonly DistributedApplication _app = fixture.Application;
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (10)
18/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 23public static Task WaitForTextAsync(this DistributedApplication app, string logText, string? resourceName = null, CancellationToken cancellationToken = default) 31public static async Task WaitForHealthyAsync<T>(this DistributedApplication app, IResourceBuilder<T> resource, CancellationToken cancellationToken = default) where T: IResource 42/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 47public static Task WaitForTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 58/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 63public static Task WaitForTextAsync(this DistributedApplication app, Predicate<string> predicate, string? resourceName = null, CancellationToken cancellationToken = default) 82/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 87public static async Task WaitForAllTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 112private static async Task WatchNotifications(DistributedApplication app, string? resourceName, Predicate<string> predicate, TaskCompletionSource tcs, CancellationTokenSource cancellationTokenSource)
Aspire.Hosting.Tests (213)
AddParameterTests.cs (16)
19var appBuilder = DistributedApplication.CreateBuilder(); 24using var app = appBuilder.Build(); 57var appBuilder = DistributedApplication.CreateBuilder(); 61using var app = appBuilder.Build(); 99var appBuilder = DistributedApplication.CreateBuilder(); 108using var app = appBuilder.Build(); 124var appBuilder = DistributedApplication.CreateBuilder(); 143using var app = appBuilder.Build(); 174var appBuilder = DistributedApplication.CreateBuilder(); 193using var app = appBuilder.Build(); 222var appBuilder = DistributedApplication.CreateBuilder(); 236var appBuilder = DistributedApplication.CreateBuilder(); 250using var app = appBuilder.Build(); 282var appBuilder = DistributedApplication.CreateBuilder(); 296var appBuilder = DistributedApplication.CreateBuilder(); 306using var app = appBuilder.Build();
Codespaces\CodespacesUrlRewriterTests.cs (2)
32using var app = builder.Build(); 70using var app = builder.Build();
Dashboard\DashboardLifecycleHookTests.cs (1)
117NullLogger<DistributedApplication>.Instance,
Dashboard\DashboardResourceTests.cs (14)
42using var app = builder.Build(); 66using var app = builder.Build(); 97using var app = builder.Build(); 167var app = builder.Build(); 203using var app = builder.Build(); 238using var app = builder.Build(); 270using var app = builder.Build(); 306using var app = builder.Build(); 349using var app = builder.Build(); 374using var app = builder.Build(); 390var app = builder.Build(); 412using var app = builder.Build(); 443var app = builder.Build(); 507var app = builder.Build();
Dcp\ApplicationExecutorTests.cs (51)
30var builder = DistributedApplication.CreateBuilder(); 35using var app = builder.Build(); 51var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 60using var app = builder.Build(); 106var builder = DistributedApplication.CreateBuilder(); 112using var app = builder.Build(); 137var builder = DistributedApplication.CreateBuilder(); 144using var app = builder.Build(); 169var builder = DistributedApplication.CreateBuilder(); 176using var app = builder.Build(); 201var builder = DistributedApplication.CreateBuilder(); 209using var app = builder.Build(); 239var builder = DistributedApplication.CreateBuilder(); 246using var app = builder.Build(); 256var builder = DistributedApplication.CreateBuilder(); 266using var app = builder.Build(); 290var builder = DistributedApplication.CreateBuilder(); 300using var app = builder.Build(); 324var builder = DistributedApplication.CreateBuilder(); 334using var app = builder.Build(); 392var builder = DistributedApplication.CreateBuilder(); 398using var app = builder.Build(); 411var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 420using var app = builder.Build(); 438var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 456using var app = builder.Build(); 527var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 554using var app = builder.Build(); 647var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 660using var app = builder.Build(); 694var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 705using var app = builder.Build(); 735var builder = DistributedApplication.CreateBuilder(); 742using var app = builder.Build(); 769var builder = DistributedApplication.CreateBuilder(); 777using var app = builder.Build(); 831var builder = DistributedApplication.CreateBuilder(); 837using var app = builder.Build(); 848var builder = DistributedApplication.CreateBuilder(); 858using var app = builder.Build(); 884var builder = DistributedApplication.CreateBuilder(); 894using var app = builder.Build(); 920var builder = DistributedApplication.CreateBuilder(); 931using var app = builder.Build(); 957var builder = DistributedApplication.CreateBuilder(); 961using var app = builder.Build(); 975var builder = DistributedApplication.CreateBuilder(); 981using var app = builder.Build(); 994var builder = DistributedApplication.CreateBuilder(); 1000using var app = builder.Build(); 1074NullLogger<DistributedApplication>.Instance,
Dcp\DcpCliArgsTests.cs (4)
16var builder = DistributedApplication.CreateBuilder([ 26var builder = DistributedApplication.CreateBuilder([ 36var builder = DistributedApplication.CreateBuilder([ 46var builder = DistributedApplication.CreateBuilder(
DcpVisibilityTests.cs (1)
12var hostingAssembly = typeof(DistributedApplication).Assembly;
DistributedApplicationBuilderTests.cs (17)
23var builder = DistributedApplication.CreateBuilder(args); 30var appBuilder = DistributedApplication.CreateBuilder(); 38using var app = appBuilder.Build(); 60var appBuilder = DistributedApplication.CreateBuilder(); 62using var app = appBuilder.Build(); 72var appBuilder = DistributedApplication.CreateBuilder(["--publisher", "manifest", "--output-path", "/tmp/"]); 83var appBuilder = DistributedApplication.CreateBuilder(["--publisher", "manifest", "--output-path", "/tmp/"]); 96var appBuilder = DistributedApplication.CreateBuilder(); 98using var app = appBuilder.Build(); 107var appBuilder = DistributedApplication.CreateBuilder(); 108using var app = appBuilder.Build(); 118var appBuilder = DistributedApplication.CreateBuilder(args: [$"{KnownConfigNames.DashboardUnsecuredAllowAnonymous}=true"]); 119using var app = appBuilder.Build(); 129var appBuilder = DistributedApplication.CreateBuilder(); 140var appBuilder = DistributedApplication.CreateBuilder(); 151var appBuilder = DistributedApplication.CreateBuilder(); 163var appBuilder = DistributedApplication.CreateBuilder();
DistributedApplicationTests.cs (20)
154await using var app = testProgram.Build(); 190await using var app = testProgram.Build(); 247await using var app = testProgram.Build(); 277await using var app = testProgram.Build(); 314await using var app = testProgram.Build(); 357await using var app = testProgram.Build(); 410await using var app = testProgram.Build(); 449await using var app = testProgram.Build(); 482await using var app = testProgram.Build(); 511await using var app = testProgram.Build(); 540await using var app = testProgram.Build(); 570await using var app = testProgram.Build(); 596await using var app = testProgram.Build(); 657await using var app = testProgram.Build(); 676await using var app = testProgram.Build(); 698await using var app = testProgram.Build(); 739await using var app = testProgram.Build(); 805using var app = builder.Build(); 849using var app = builder.Build(); 866using var app = builder.Build();
Eventing\DistributedApplicationBuilderEventingTests.cs (4)
168using var app = builder.Build(); 190using var app = builder.Build(); 217using var app = builder.Build(); 256using var app = builder.Build();
ExecutableResourceTests.cs (2)
16var appBuilder = DistributedApplication.CreateBuilder(); 37using var app = appBuilder.Build();
ExpressionResolverTests.cs (3)
33var builder = DistributedApplication.CreateBuilder(); 84var builder = DistributedApplication.CreateBuilder(); 106var builder = DistributedApplication.CreateBuilder();
Health\ResourceHealthCheckServiceTests.cs (9)
24await using var app = await builder.BuildAsync().DefaultTimeout(); 58await using var app = await builder.BuildAsync().DefaultTimeout(); 101using var app = builder.Build(); 148using var app = builder.Build(); 188using var app = builder.Build(); 219using var app = builder.Build(); 268using var app = builder.Build(); 328using var app = builder.Build(); 381using var app = builder.Build();
HealthCheckTests.cs (4)
27using var app = builder.Build(); 49using var app = builder.Build(); 82using var app = builder.Build(); 115var app = builder.Build();
KestrelConfigTests.cs (1)
359DistributedApplication app = appBuilder.Build();
ManifestGenerationTests.cs (4)
91var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 150var appBuilder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions 157using var program = appBuilder.Build(); 497var appBuilder = DistributedApplication.CreateBuilder();
ProjectResourceTests.cs (18)
67using var app = appBuilder.Build(); 181using var app = appBuilder.Build(); 208using var app = appBuilder.Build(); 226using var app = appBuilder.Build(); 242using var app = appBuilder.Build(); 290using var app = appBuilder.Build(); 310using var app = appBuilder.Build(); 353using var app = appBuilder.Build(); 375using var app = appBuilder.Build(); 400using var app = appBuilder.Build(); 431using var app = appBuilder.Build(); 449using var app = appBuilder.Build(); 473using var app = appBuilder.Build(); 523using var app = appBuilder.Build(); 569var appBuilder = DistributedApplication.CreateBuilder(); 585using var app = appBuilder.Build(); 615using var app = appBuilder.Build(); 651var appBuilder = DistributedApplication.CreateBuilder(resolvedArgs.ToArray());
PublishAsConnectionStringTests.cs (1)
15var builder = DistributedApplication.CreateBuilder();
PublishAsDockerfileTests.cs (3)
15var builder = DistributedApplication.CreateBuilder(); 44var builder = DistributedApplication.CreateBuilder(); 86var builder = DistributedApplication.CreateBuilder();
ResourceCommandAnnotationTests.cs (1)
39var builder = DistributedApplication.CreateBuilder();
ResourceExtensionsTests.cs (5)
147var builder = DistributedApplication.CreateBuilder(); 157var builder = DistributedApplication.CreateBuilder(); 167var builder = DistributedApplication.CreateBuilder(); 199var builder = DistributedApplication.CreateBuilder(); 232var builder = DistributedApplication.CreateBuilder();
ResourceNotificationTests.cs (1)
18var builder = DistributedApplication.CreateBuilder();
SlimTestProgramTests.cs (1)
33var app = testProgram.App ?? throw new ArgumentException("TestProgram.App is null");
TestProgramFixture.cs (2)
16private DistributedApplication? _app; 21public DistributedApplication App => _app ?? throw new InvalidOperationException("DistributedApplication is not initialized.");
tests\Aspire.Hosting.Testing.Tests\DistributedApplicationHttpClientExtensionsForTests.cs (1)
11public static HttpClient CreateHttpClientWithResilience(this DistributedApplication app, string resourceName, string? endpointName = default)
Utils\LoggerNotificationExtensions.cs (10)
18/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 23public static Task WaitForTextAsync(this DistributedApplication app, string logText, string? resourceName = null, CancellationToken cancellationToken = default) 31public static async Task WaitForHealthyAsync<T>(this DistributedApplication app, IResourceBuilder<T> resource, CancellationToken cancellationToken = default) where T: IResource 42/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 47public static Task WaitForTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 58/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 63public static Task WaitForTextAsync(this DistributedApplication app, Predicate<string> predicate, string? resourceName = null, CancellationToken cancellationToken = default) 82/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 87public static async Task WaitForAllTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 112private static async Task WatchNotifications(DistributedApplication app, string? resourceName, Predicate<string> predicate, TaskCompletionSource tcs, CancellationTokenSource cancellationTokenSource)
Utils\TestDistributedApplicationBuilder.cs (3)
31private DistributedApplication? _app; 139public DistributedApplication Build() => _app = _innerBuilder.Build(); 141public Task<DistributedApplication> BuildAsync(CancellationToken cancellationToken = default) => Task.FromResult(Build());
Utils\VolumeNameGeneratorTests.cs (2)
15var builder = DistributedApplication.CreateBuilder(); 30var builder = DistributedApplication.CreateBuilder();
Utils\WithAnnotationTests.cs (3)
13var builder = DistributedApplication.CreateBuilder(); 27var builder = DistributedApplication.CreateBuilder(); 41var builder = DistributedApplication.CreateBuilder();
WaitForTests.cs (7)
28using var app = builder.Build(); 93using var app = builder.Build(); 134using var app = builder.Build(); 182using var app = builder.Build(); 230using var app = builder.Build(); 279using var app = builder.Build(); 313using var app = builder.Build();
WithEndpointTests.cs (1)
208using var app = builder.Build();
WithEnvironmentTests.cs (1)
26using var app = builder.Build();
Aspire.Hosting.Valkey.Tests (10)
AddValkeyTests.cs (6)
17var appBuilder = DistributedApplication.CreateBuilder(); 20using var app = appBuilder.Build(); 45var appBuilder = DistributedApplication.CreateBuilder(); 48using var app = appBuilder.Build(); 73var appBuilder = DistributedApplication.CreateBuilder(); 77await using var app = appBuilder.Build();
ValkeyFunctionalTests.cs (4)
28using var app = builder.Build(); 87using (var app = builder1.Build()) 139using (var app = builder2.Build()) 215using var app = builder.Build();
Aspire.Playground.Tests (24)
AppHostTests.cs (5)
42await using var app = await appHost.BuildAsync(); 124public static HttpClient CreateHttpClientWithResilience(DistributedApplication app, string resource) 265private static async Task TestEventHubsAppHost(DistributedApplication app, string appHostPath, ITestOutputHelper testOutput) 320Func<DistributedApplication, string, ITestOutputHelper, Task>? whenReady = null) 336public Func<DistributedApplication, string, ITestOutputHelper, Task>? WhenReady { get; set; }
Infrastructure\DistributedApplicationExtensions.cs (8)
85public static Task WaitForResource(this DistributedApplication app, string resourceName, string? targetState = null, CancellationToken cancellationToken = default) 99public static Task WaitForResources(this DistributedApplication app, IEnumerable<string>? targetStates = null, CancellationToken cancellationToken = default) 111public static (IReadOnlyList<FakeLogRecord> AppHostLogs, IReadOnlyList<FakeLogRecord> ResourceLogs) GetLogs(this DistributedApplication app) 129public static void EnsureNoErrorsLogged(this DistributedApplication app) 169public static HttpClient CreateHttpClient(this DistributedApplication app, string resourceName, bool useHttpClientFactory) 175public static HttpClient CreateHttpClient(this DistributedApplication app, string resourceName, string? endpointName, bool useHttpClientFactory) 194public static HttpClient CreateHttpClient(this DistributedApplication app, string resourceName, string? endpointName, Action<IHttpClientBuilder> configure) 211public static async Task<bool> TryApplyEfMigrationsAsync(this DistributedApplication app, ProjectResource project)
ProjectSpecificTests.cs (1)
133internal static Task WaitForAllTextAsync(DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, int timeoutSecs = -1)
tests\Aspire.Hosting.Tests\Utils\LoggerNotificationExtensions.cs (10)
18/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 23public static Task WaitForTextAsync(this DistributedApplication app, string logText, string? resourceName = null, CancellationToken cancellationToken = default) 31public static async Task WaitForHealthyAsync<T>(this DistributedApplication app, IResourceBuilder<T> resource, CancellationToken cancellationToken = default) where T: IResource 42/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 47public static Task WaitForTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 58/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 63public static Task WaitForTextAsync(this DistributedApplication app, Predicate<string> predicate, string? resourceName = null, CancellationToken cancellationToken = default) 82/// <param name="app">The <see cref="DistributedApplication" /> instance to watch.</param> 87public static async Task WaitForAllTextAsync(this DistributedApplication app, IEnumerable<string> logTexts, string? resourceName = null, CancellationToken cancellationToken = default) 112private static async Task WatchNotifications(DistributedApplication app, string? resourceName, Predicate<string> predicate, TaskCompletionSource tcs, CancellationTokenSource cancellationTokenSource)
AzureContainerApps.AppHost (1)
Program.cs (1)
6var builder = DistributedApplication.CreateBuilder(args);
AzureFunctionsEndToEnd.AppHost (1)
Program.cs (1)
1var builder = DistributedApplication.CreateBuilder(args);
AzureSearch.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
AzureStorageEndToEnd.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
BicepSample.AppHost (1)
Program.cs (1)
6var builder = DistributedApplication.CreateBuilder(args);
BrowserTelemetry.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
CdkSample.AppHost (1)
Program.cs (1)
10var builder = DistributedApplication.CreateBuilder(args);
CosmosEndToEnd.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
CustomResources.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
Dapr.AppHost (2)
Program.cs (2)
1var builder = DistributedApplication.CreateBuilder(args); 36using var app = builder.Build();
DatabaseMigration.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
Elasticsearch.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
EventHubs.AppHost (1)
Program.cs (1)
1var builder = DistributedApplication.CreateBuilder(args);
HealthChecksSandbox.AppHost (1)
Program.cs (1)
8var builder = DistributedApplication.CreateBuilder(args);
KafkaBasic.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
Keycloak.AppHost (1)
Program.cs (1)
1var builder = DistributedApplication.CreateBuilder(args);
MilvusPlayground.AppHost (1)
Program.cs (1)
1var builder = DistributedApplication.CreateBuilder(args);
Mongo.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
MySqlDb.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
Nats.AppHost (1)
Program.cs (1)
1var builder = DistributedApplication.CreateBuilder(args);
OpenAIEndToEnd.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
OracleEndToEnd.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
Orleans.AppHost (2)
Program.cs (2)
1var builder = DistributedApplication.CreateBuilder(args); 37using var app = builder.Build();
ParameterEndToEnd.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
PostgresEndToEnd.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
ProxylessEndToEnd.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
Python.AppHost (1)
Program.cs (1)
6var builder = DistributedApplication.CreateBuilder(args);
Qdrant.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
Redis.AppHost (1)
Program.cs (1)
1var builder = DistributedApplication.CreateBuilder(args);
Seq.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
ServiceBus.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
SignalR.AppHost (1)
Program.cs (1)
1var builder = DistributedApplication.CreateBuilder(args);
SqlServerEndToEnd.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
Stress.AppHost (1)
Program.cs (1)
6var builder = DistributedApplication.CreateBuilder(args);
TestingAppHost1.AppHost (2)
Program.cs (2)
6var builder = DistributedApplication.CreateBuilder(args); 22var app = builder.Build();
TestProject.AppHost (5)
TestProgram.cs (5)
45var builder = DistributedApplication.CreateBuilder(new DistributedApplicationOptions() 115public DistributedApplication? App { get; private set; } 121var app = Build(); 125public DistributedApplication Build() 132var app = Build();
TestShop.AppHost (1)
Program.cs (1)
1var builder = DistributedApplication.CreateBuilder(args);
WaitForSandbox.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);
WebPubSub.AppHost (1)
Program.cs (1)
2var builder = DistributedApplication.CreateBuilder(args);
WithDockerfile.AppHost (1)
Program.cs (1)
4var builder = DistributedApplication.CreateBuilder(args);