2 implementations of Services
Aspire.Hosting (1)
DistributedApplicationBuilder.cs (1)
63public IServiceCollection Services => _innerBuilder.Services;
Aspire.Hosting.Tests (1)
Utils\TestDistributedApplicationBuilder.cs (1)
123public IServiceCollection Services => _innerBuilder.Services;
72 references to Services
Aspire.Hosting (4)
DistributedApplication.cs (1)
201/// To add services to the dependency injection container developers should use the <see cref="IDistributedApplicationBuilder.Services"/>
ParameterResourceBuilderExtensions.cs (1)
186builder.Services.AddLifecycleHook((sp) => new WriteParameterLogsHook(
ResourceBuilderExtensions.cs (2)
906builder.ApplicationBuilder.Services.AddLogging(configure => 913builder.ApplicationBuilder.Services.AddHealthChecks().AddUrlGroup((UriHealthCheckOptions options) =>
Aspire.Hosting.Azure (4)
Provisioning\AzureProvisionerExtensions.cs (4)
25builder.Services.TryAddLifecycleHook<AzureProvisioner>(); 28builder.Services.AddOptions<AzureProvisionerOptions>() 43builder.Services.AddKeyedSingleton<IAzureResourceProvisioner, TProvisioner>(typeof(TResource)); 52builder.Services.AddSingleton<IAzureResourceEnumerator>(new AzureResourceEnumerator<TResource>(getResources, getTags));
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppExtensions.cs (1)
20builder.Services.TryAddLifecycleHook<AzureContainerAppsInfrastructure>();
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
121builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureCosmosDB(
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsExtensions.cs (1)
213builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureEventHub(
Aspire.Hosting.Azure.ServiceBus (1)
AzureServiceBusExtensions.cs (1)
425builder.ApplicationBuilder.Services.AddHealthChecks()
Aspire.Hosting.Azure.Storage (1)
AzureStorageExtensions.cs (1)
124builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureBlobStorage(sp =>
Aspire.Hosting.Containers.Tests (4)
WithDockerfileTests.cs (4)
161builder.Services.AddLogging(b => b.AddXunit(testOutputHelper)); 209builder.Services.AddLogging(b => b.AddXunit(testOutputHelper)); 256builder.Services.AddLogging(b => b.AddXunit(testOutputHelper)); 302builder.Services.AddLogging(b => b.AddXunit(testOutputHelper));
Aspire.Hosting.Dapr (2)
IDistributedApplicationBuilderExtensions.cs (2)
29builder.Services.Configure(configure); 31builder.Services.TryAddLifecycleHook<DaprDistributedApplicationLifecycleHook>();
Aspire.Hosting.Elasticsearch (1)
ElasticsearchBuilderExtensions.cs (1)
74builder.Services.AddHealthChecks()
Aspire.Hosting.Garnet (1)
GarnetBuilderExtensions.cs (1)
76builder.Services.AddHealthChecks().AddRedis(sp => connectionString ?? throw new InvalidOperationException("Connection string is unavailable"), name: healthCheckKey);
Aspire.Hosting.Kafka (1)
KafkaBuilderExtensions.cs (1)
71builder.Services.AddHealthChecks().Add(healthCheckRegistration);
Aspire.Hosting.MongoDB (2)
MongoDBBuilderExtensions.cs (2)
77builder.Services.AddHealthChecks() 128builder.ApplicationBuilder.Services.AddHealthChecks()
Aspire.Hosting.MySql (1)
MySqlBuilderExtensions.cs (1)
51builder.Services.AddHealthChecks().AddMySql(sp => connectionString ?? throw new InvalidOperationException("Connection string is unavailable"), name: healthCheckKey);
Aspire.Hosting.Nats (1)
NatsBuilderExtensions.cs (1)
85builder.Services.AddHealthChecks()
Aspire.Hosting.Oracle (1)
OracleDatabaseBuilderExtensions.cs (1)
47builder.Services.AddHealthChecks()
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
66builder.Services.AddHealthChecks().AddNpgSql(sp => connectionString ?? throw new InvalidOperationException("Connection string is unavailable"), name: healthCheckKey, configure: (connection) =>
Aspire.Hosting.Qdrant (1)
QdrantBuilderExtensions.cs (1)
62builder.Services.AddHealthChecks()
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
58builder.Services.AddHealthChecks().AddRabbitMQ(async (sp) =>
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
58builder.Services.AddHealthChecks().AddRedis(sp => connectionString ?? throw new InvalidOperationException("Connection string is unavailable"), name: healthCheckKey);
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
49builder.Services.AddHealthChecks().AddSqlServer(sp => connectionString ?? throw new InvalidOperationException("Connection string is unavailable"), name: healthCheckKey);
Aspire.Hosting.Tests (31)
DistributedApplicationBuilderTests.cs (1)
32appBuilder.Services.Configure<DcpOptions>(o =>
DistributedApplicationTests.cs (26)
50testProgram.AppBuilder.Services.AddLifecycleHook((sp) => 80testProgram.AppBuilder.Services.AddLifecycleHook((sp) => 90testProgram.AppBuilder.Services.AddLifecycleHook((sp) => 118testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 119testProgram.AppBuilder.Services.AddHealthChecks().AddCheck("dummy_healthcheck", () => HealthCheckResult.Unhealthy()); 162testProgram.AppBuilder.Services.AddLifecycleHook((sp) => 183testProgram.AppBuilder.Services.TryAddLifecycleHook(callback1); 186testProgram.AppBuilder.Services.TryAddLifecycleHook(callback2); 188var lifecycleHookDescriptors = testProgram.AppBuilder.Services.Where(sd => sd.ServiceType == typeof(IDistributedApplicationLifecycleHook)); 200testProgram.AppBuilder.Services.AddLifecycleHook(sp => new CheckAllocatedEndpointsLifecycleHook(tcs)); 234testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 289testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 320testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 372testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 406testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 468testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 507testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 537testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 565testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 595testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 625testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 654testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 715testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 734testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 756testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 797testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper));
ManifestGenerationTests.cs (3)
118appBuilder.Services.AddKeyedSingleton<IDistributedApplicationPublisher, JsonDocumentManifestPublisher>("manifest"); 277program.AppBuilder.Services.Configure<PublishingOptions>(options => 507program.AppBuilder.Services.AddKeyedSingleton<IDistributedApplicationPublisher, JsonDocumentManifestPublisher>("manifest");
ProjectResourceTests.cs (1)
653appBuilder.Services.AddKeyedSingleton<IDistributedApplicationPublisher, NoopPublisher>("manifest");
Aspire.Hosting.Valkey (1)
ValkeyBuilderExtensions.cs (1)
74builder.Services.AddHealthChecks()
CustomResources.AppHost (1)
TestResource.cs (1)
12builder.Services.TryAddLifecycleHook<TestResourceLifecycleHook>();
HealthChecksSandbox.AppHost (2)
Program.cs (2)
10builder.Services.TryAddLifecycleHook<TestResourceLifecycleHook>(); 31builder.Services.AddHealthChecks()
Stress.AppHost (3)
Program.cs (2)
8builder.Services.AddHttpClient(); 9builder.Services.AddHealthChecks().AddAsyncCheck("health-test", async (ct) =>
TestResource.cs (1)
13builder.Services.TryAddLifecycleHook<TestResourceLifecycleHook>();
TestProject.AppHost (2)
TestProgram.cs (2)
88AppBuilder.Services.AddLifecycleHook<EndPointWriterHook>(); 89AppBuilder.Services.AddHttpClient();