130 instantiations of BeforeResourceStartedEvent
Aspire.Hosting (3)
ConnectionStringBuilderExtensions.cs (1)
93await @evt.Eventing.PublishAsync(new BeforeResourceStartedEvent(r, @evt.Services), ct).ConfigureAwait(false);
ExternalServiceBuilderExtensions.cs (1)
168await e.Eventing.PublishAsync(new BeforeResourceStartedEvent(e.Resource, e.Services), ct).ConfigureAwait(false);
Orchestrator\ApplicationOrchestrator.cs (1)
277var beforeResourceStartedEvent = new BeforeResourceStartedEvent(context.Resource, _serviceProvider)
Aspire.Hosting.Azure (1)
AzureProvisioningController.cs (1)
3914var beforeResourceStartedEvent = new BeforeResourceStartedEvent(resource.Resource, serviceProvider);
Aspire.Hosting.Azure.EntraId (1)
EntraIdResourceExtensions.cs (1)
131await evt.Eventing.PublishAsync(new BeforeResourceStartedEvent(resource, evt.Services), cancellationToken).ConfigureAwait(false);
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
226await eventing.PublishAsync<BeforeResourceStartedEvent>(new(portResource, e.Services), EventDispatchBehavior.NonBlockingConcurrent, ct).ConfigureAwait(false);
Aspire.Hosting.DevTunnels.Tests (2)
DevTunnelResourceBuilderExtensionsTests.cs (2)
224await builder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnel.Resource, app.Services)).DefaultTimeout(); 264await builder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnel.Resource, app.Services)).DefaultTimeout();
Aspire.Hosting.Dotnet.Tests (19)
DotnetProjectBuildCoordinatorTests.cs (18)
75new BeforeResourceStartedEvent(buildResource, app.Services), 113new BeforeResourceStartedEvent(buildResource, app.Services), 157new BeforeResourceStartedEvent(buildResource, app.Services), 174new BeforeResourceStartedEvent(buildResource, app.Services), 219new BeforeResourceStartedEvent(buildResource, app.Services), 236new BeforeResourceStartedEvent(rebuilder, app.Services), 430new BeforeResourceStartedEvent(buildResource, app.Services), 450new BeforeResourceStartedEvent(rebuilder, app.Services), 538new BeforeResourceStartedEvent(projectBuild, app.Services), 541new BeforeResourceStartedEvent(fileBuild, app.Services), 1428new BeforeResourceStartedEvent(buildResource, app.Services), 1445new BeforeResourceStartedEvent(buildResource, app.Services), 1652new BeforeResourceStartedEvent(buildResource, app.Services), 1700new BeforeResourceStartedEvent(rebuilder, app.Services), 1769new BeforeResourceStartedEvent(buildResource, app.Services), 1779new BeforeResourceStartedEvent(rebuilder, app.Services), 1905new BeforeResourceStartedEvent(buildResource, app.Services), 1928new BeforeResourceStartedEvent(rebuilder, app.Services),
DotnetProjectResourceTests.cs (1)
535new BeforeResourceStartedEvent(rebuilder, app.Services),
Aspire.Hosting.Java.Tests (16)
AddJavaAppTests.cs (4)
747new BeforeResourceStartedEvent(app.Resource, built.Services), 766new BeforeResourceStartedEvent(app.Resource, built.Services), 793new BeforeResourceStartedEvent(app.Resource, built.Services), 854new BeforeResourceStartedEvent(app.Resource, built.Services),
AddQuarkusAppTests.cs (3)
97new BeforeResourceStartedEvent(app.Resource, application.Services), 114new BeforeResourceStartedEvent(app.Resource, application.Services), 286new BeforeResourceStartedEvent(app.Resource, application.Services),
AddSpringBootAppTests.cs (9)
22new BeforeResourceStartedEvent(app.Resource, application.Services), 39new BeforeResourceStartedEvent(app.Resource, application.Services), 56new BeforeResourceStartedEvent(app.Resource, application.Services), 76new BeforeResourceStartedEvent(runApp.Resource, application.Services), 114new BeforeResourceStartedEvent(app.Resource, application.Services), 137new BeforeResourceStartedEvent(app.Resource, application.Services), 190new BeforeResourceStartedEvent(app.Resource, application.Services), 211new BeforeResourceStartedEvent(runApp.Resource, application.Services), 238new BeforeResourceStartedEvent(app.Resource, application.Services),
Aspire.Hosting.Kafka.Tests (1)
AddKafkaTests.cs (1)
295new BeforeResourceStartedEvent(kafkaUiResource, app.Services),
Aspire.Hosting.Maui.Tests (52)
MauiBuildQueueTests.cs (38)
58new BeforeResourceStartedEvent(env.Android, env.Services), 78new BeforeResourceStartedEvent(env.Android, env.Services), 91new BeforeResourceStartedEvent(env.Android, env.Services), 98new BeforeResourceStartedEvent(env.MacCatalyst, env.Services), 119new BeforeResourceStartedEvent(env.Android, env.Services), 140new BeforeResourceStartedEvent(env.MacCatalyst, env.Services), 174new BeforeResourceStartedEvent(env.Android, env.Services), 191new BeforeResourceStartedEvent(env.Android, env.Services), 195new BeforeResourceStartedEvent(env.Android2!, env.Services), 222new BeforeResourceStartedEvent(env.Android, env.Services), 236new BeforeResourceStartedEvent(env.Android, env.Services), 244new BeforeResourceStartedEvent(env.MacCatalyst, env.Services), 259new BeforeResourceStartedEvent(env.IOSSimulator, env.Services), 273new BeforeResourceStartedEvent(env.Android, env.Services), 286new BeforeResourceStartedEvent(env.MacCatalyst, env.Services), 294new BeforeResourceStartedEvent(env.IOSSimulator, env.Services), 352new BeforeResourceStartedEvent(env.Android, env.Services), 359new BeforeResourceStartedEvent(env.Parent, env.Services), 376new BeforeResourceStartedEvent(env.Android, env.Services), 386new BeforeResourceStartedEvent(env.Android, env.Services), 417new BeforeResourceStartedEvent(android, app.Services), 455new BeforeResourceStartedEvent(android, app.Services), 476new BeforeResourceStartedEvent(env.Android, env.Services), 523new BeforeResourceStartedEvent(env.Android, env.Services), 531new BeforeResourceStartedEvent(env.MacCatalyst, env.Services), 562new BeforeResourceStartedEvent(env.Android, env.Services), 597new BeforeResourceStartedEvent(env.Android, env.Services), 619new BeforeResourceStartedEvent(env.Android, env.Services), 696new BeforeResourceStartedEvent(env.Android, env.Services), 699new BeforeResourceStartedEvent(env.MacCatalyst, env.Services), 850new BeforeResourceStartedEvent(env.Android, env.Services), 868new BeforeResourceStartedEvent(env.Android, env.Services), 938new BeforeResourceStartedEvent(env.Android, env.Services), 958new BeforeResourceStartedEvent(env.Android, env.Services), 1045new BeforeResourceStartedEvent(env.Android, env.Services), 1055new BeforeResourceStartedEvent(env.MacCatalyst, env.Services), 1059new BeforeResourceStartedEvent(env.IOSSimulator, env.Services), 1102new BeforeResourceStartedEvent(env.Android, env.Services),
MauiiOSValidationTests.cs (6)
36.PublishAsync(new BeforeResourceStartedEvent(device.Resource, app.Services), CancellationToken.None) 62.PublishAsync(new BeforeResourceStartedEvent(simulator.Resource, app.Services), CancellationToken.None) 87.PublishAsync(new BeforeResourceStartedEvent(device.Resource, app.Services), CancellationToken.None) 108.PublishAsync(new BeforeResourceStartedEvent(simulator.Resource, app.Services), CancellationToken.None) 127.PublishAsync(new BeforeResourceStartedEvent(device.Resource, app.Services), CancellationToken.None) 146.PublishAsync(new BeforeResourceStartedEvent(simulator.Resource, app.Services), CancellationToken.None)
MauiPlatformExtensionsTests.cs (8)
296.PublishAsync(new BeforeResourceStartedEvent(platform.Resource, app.Services), CancellationToken.None) 594await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services), CancellationToken.None).DefaultTimeout(); 1119appBuilder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnelConfig.DevTunnel.Resource, app.Services), CancellationToken.None).DefaultTimeout()); 1145appBuilder.Eventing.PublishAsync(new BeforeResourceStartedEvent(tunnelConfig.DevTunnel.Resource, app.Services), CancellationToken.None).DefaultTimeout()); 1175new BeforeResourceStartedEvent(tunnelConfig.DevTunnel.Resource, app.Services), 1226new BeforeResourceStartedEvent(resolutionEventResource, app.Services), 1250new BeforeResourceStartedEvent(resolutionEventResource, app.Services), 1342new BeforeResourceStartedEvent(tunnelConfig.DevTunnel.Resource, app.Services),
Aspire.Hosting.MongoDB (1)
ReplicaSet\MongoDBReplicaSetBuilderExtensions.cs (1)
126await evt.Eventing.PublishAsync(new BeforeResourceStartedEvent(resource, evt.Services), ct)
Aspire.Hosting.MongoDB.Tests (1)
ReplicaSet\AddMongoDBReplicaSetTests.cs (1)
352await eventing.PublishAsync(new BeforeResourceStartedEvent(mongo1.Resource, app.Services));
Aspire.Hosting.MySql.Tests (3)
AddMySqlTests.cs (3)
260await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(myAdmin, app.Services)); 291builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(myAdmin, app.Services)); 401new BeforeResourceStartedEvent(phpMyAdminResource, app.Services),
Aspire.Hosting.Redis.Tests (3)
AddRedisTests.cs (3)
563await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 589await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 610await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services));
Aspire.Hosting.Tests (23)
Orchestrator\ApplicationOrchestratorTests.cs (1)
1140await @event.Eventing.PublishAsync(new BeforeResourceStartedEvent(resource, @event.Services), ct);
ProjectRebuilderResourceTests.cs (3)
31new BeforeResourceStartedEvent(rebuilder, app.Services), 35new BeforeResourceStartedEvent(rebuilder, app.Services), 67new BeforeResourceStartedEvent(rebuilder, app.Services),
ProjectResourceTests.cs (1)
1071new BeforeResourceStartedEvent(appResource.Resource, app.Services),
RequiredCommandAnnotationTests.cs (17)
156await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 173await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 191await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 214await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 241await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 267await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 288await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 309await eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 310await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services)); 340await eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 341await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services)); 375await eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 376await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services)); 400var publishTask = eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 431await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, app.Services)); 458var publishTask1 = eventing.PublishAsync(new BeforeResourceStartedEvent(resource1, app.Services)); 464await eventing.PublishAsync(new BeforeResourceStartedEvent(resource2, app.Services));
WithUrlsTests.cs (1)
587await e.Eventing.PublishAsync(new BeforeResourceStartedEvent(custom, e.Services), EventDispatchBehavior.BlockingSequential, ct);
CustomResources.AppHost (3)
TalkingClockResource.cs (3)
66await eventing.PublishAsync(new BeforeResourceStartedEvent(resource, services), token); 67await eventing.PublishAsync(new BeforeResourceStartedEvent(resource.TickHand, services), token); 68await eventing.PublishAsync(new BeforeResourceStartedEvent(resource.TockHand, services), token);
40 references to BeforeResourceStartedEvent
Aspire.Hosting (12)
Ats\EventingExports.cs (1)
72internal static IResourceBuilder<T> OnBeforeResourceStarted<T>(this IResourceBuilder<T> builder, Func<BeforeResourceStartedEvent, Task> callback)
Dashboard\DashboardEventHandlers.cs (1)
226eventing.Subscribe<BeforeResourceStartedEvent>(dashboardResource, (@event, _) =>
DistributedApplicationEventingExtensions.cs (2)
52/// Subscribes a callback to the <see cref="BeforeResourceStartedEvent"/> event within the AppHost. 60public static IResourceBuilder<T> OnBeforeResourceStarted<T>(this IResourceBuilder<T> builder, Func<T, BeforeResourceStartedEvent, CancellationToken, Task> callback)
DotnetToolResourceExtensions.cs (1)
100async Task BeforeResourceStarted(T resource, BeforeResourceStartedEvent evt, CancellationToken ct)
Lifecycle\DotnetBuildCommandEventingSubscriber.cs (2)
23eventing.Subscribe<BeforeResourceStartedEvent>(ConfigureMultiThreadedBuildAsync); 28BeforeResourceStartedEvent @event,
Lifecycle\RequiredCommandValidationEventingSubscriber.cs (2)
27eventing.Subscribe<BeforeResourceStartedEvent>(ValidateRequiredCommandsAsync); 31private async Task ValidateRequiredCommandsAsync(BeforeResourceStartedEvent @event, CancellationToken cancellationToken)
Orchestrator\ApplicationOrchestrator.cs (3)
79_eventing.Subscribe<BeforeResourceStartedEvent>(WaitForInBeforeResourceStartedEvent); 116private async Task WaitForInBeforeResourceStartedEvent(BeforeResourceStartedEvent @event, CancellationToken cancellationToken) 277var beforeResourceStartedEvent = new BeforeResourceStartedEvent(context.Resource, _serviceProvider)
Aspire.Hosting.Azure (1)
AzureProvisioningController.cs (1)
3914var beforeResourceStartedEvent = new BeforeResourceStartedEvent(resource.Resource, serviceProvider);
Aspire.Hosting.Azure.EntraId (1)
EntraIdResourceExtensions.cs (1)
135logger.LogError(ex, "A {EventName} subscriber failed.", nameof(BeforeResourceStartedEvent));
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
226await eventing.PublishAsync<BeforeResourceStartedEvent>(new(portResource, e.Services), EventDispatchBehavior.NonBlockingConcurrent, ct).ConfigureAwait(false);
Aspire.Hosting.Dotnet (3)
DotnetProjectBuildCoordinator.cs (3)
140var subscription = builder.Eventing.Subscribe<BeforeResourceStartedEvent>( 166var subscription = builder.Eventing.Subscribe<BeforeResourceStartedEvent>( 772var subscription = builder.Eventing.Subscribe<BeforeResourceStartedEvent>(
Aspire.Hosting.Kafka (1)
KafkaBuilderExtensions.cs (1)
135builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(kafkaUi, (e, ct) =>
Aspire.Hosting.Maui (7)
Lifecycle\MauiBuildQueueEventSubscriber.cs (2)
63eventing.Subscribe<BeforeResourceStartedEvent>(OnBeforeResourceStartedAsync); 67private async Task OnBeforeResourceStartedAsync(BeforeResourceStartedEvent @event, CancellationToken cancellationToken)
MauiOtlpExtensions.cs (1)
127appBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(async (evt, ct) =>
Utilities\MauiAndroidEnvironmentAnnotation.cs (2)
47eventing.Subscribe<BeforeResourceStartedEvent>(OnBeforeResourceStartedAsync); 51private async Task OnBeforeResourceStartedAsync(BeforeResourceStartedEvent @event, CancellationToken cancellationToken)
Utilities\MauiiOSEnvironmentAnnotation.cs (2)
47eventing.Subscribe<BeforeResourceStartedEvent>(OnBeforeResourceStartedAsync); 51private async Task OnBeforeResourceStartedAsync(BeforeResourceStartedEvent @event, CancellationToken cancellationToken)
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
329builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(phpMyAdminContainer, async (e, ct) =>
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
260await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(myAdmin, app.Services)); 291builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(myAdmin, app.Services));
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
302builder.ApplicationBuilder.Eventing.Subscribe<BeforeResourceStartedEvent>(resource, async (e, ct) =>
Aspire.Hosting.Redis.Tests (3)
AddRedisTests.cs (3)
563await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 589await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services)); 610await builder.Eventing.PublishAsync<BeforeResourceStartedEvent>(new(commander, app.Services));
Aspire.Hosting.Tests (7)
DistributedApplicationTests.cs (2)
1213var beforeResourceStartedEvents = Channel.CreateUnbounded<BeforeResourceStartedEvent>(); 1214events.Subscribe<BeforeResourceStartedEvent>(async (e, ct) =>
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
211builder.Eventing.Subscribe<BeforeResourceStartedEvent>((e, ct) =>
Orchestrator\ApplicationOrchestratorTests.cs (4)
476applicationEventing.Subscribe<BeforeResourceStartedEvent>(resource.Resource, (_, _) => 478observedEvents.Add(nameof(BeforeResourceStartedEvent)); 491eventName => Assert.Equal(nameof(BeforeResourceStartedEvent), eventName)); 1125/// <see cref="KnownResourceStates.NotStarted"/> and publishes <see cref="BeforeResourceStartedEvent"/> itself