2 implementations of Services
Aspire.Hosting (1)
DistributedApplicationBuilder.cs (1)
61public IServiceCollection Services => _innerBuilder.Services;
Aspire.Hosting.Tests (1)
Utils\TestDistributedApplicationBuilder.cs (1)
128public IServiceCollection Services => _innerBuilder.Services;
71 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)
875builder.ApplicationBuilder.Services.AddLogging(configure => 882builder.ApplicationBuilder.Services.AddHealthChecks().AddUrlGroup((UriHealthCheckOptions options) =>
Aspire.Hosting.AWS (2)
Provisioning\AWSProvisionerExtensions.cs (2)
24builder.Services.TryAddLifecycleHook<AWSLifecycleHook>(); 35builder.Services.AddKeyedSingleton<IAWSResourceProvisioner, TProvisioner>(typeof(TResource));
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)
141builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureCosmosDB(sp =>
Aspire.Hosting.Azure.EventHubs (1)
AzureEventHubsExtensions.cs (1)
183builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureEventHub(
Aspire.Hosting.Azure.Storage (1)
AzureStorageExtensions.cs (1)
123builder.ApplicationBuilder.Services.AddHealthChecks().AddAzureBlobStorage(sp =>
Aspire.Hosting.Containers.Tests (4)
WithDockerfileTests.cs (4)
162builder.Services.AddLogging(b => b.AddXunit(testOutputHelper)); 210builder.Services.AddLogging(b => b.AddXunit(testOutputHelper)); 257builder.Services.AddLogging(b => b.AddXunit(testOutputHelper)); 303builder.Services.AddLogging(b => b.AddXunit(testOutputHelper));
Aspire.Hosting.Dapr (2)
IDistributedApplicationBuilderExtensions.cs (2)
28builder.Services.Configure(configure); 30builder.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)
74builder.Services.AddHealthChecks().AddMongoDb(sp => connectionString ?? throw new InvalidOperationException("Connection string is unavailable"), name: healthCheckKey); 120builder.ApplicationBuilder.Services.AddHealthChecks().AddMongoDb(sp => connectionString ?? throw new InvalidOperationException("Connection string is unavailable"), name: healthCheckKey);
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)
55builder.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)
60builder.Services.AddHealthChecks()
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
55builder.Services.AddHealthChecks().AddRabbitMQ((sp, options) =>
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 (29)
DistributedApplicationBuilderTests.cs (1)
31appBuilder.Services.Configure<DcpOptions>(o =>
DistributedApplicationTests.cs (24)
45testProgram.AppBuilder.Services.AddLifecycleHook((sp) => 75testProgram.AppBuilder.Services.AddLifecycleHook((sp) => 85testProgram.AppBuilder.Services.AddLifecycleHook((sp) => 114testProgram.AppBuilder.Services.AddLifecycleHook((sp) => 135testProgram.AppBuilder.Services.TryAddLifecycleHook(callback1); 138testProgram.AppBuilder.Services.TryAddLifecycleHook(callback2); 140var lifecycleHookDescriptors = testProgram.AppBuilder.Services.Where(sd => sd.ServiceType == typeof(IDistributedApplicationLifecycleHook)); 152testProgram.AppBuilder.Services.AddLifecycleHook(sp => new CheckAllocatedEndpointsLifecycleHook(tcs)); 186testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 241testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 272testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 312testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 346testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 408testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 447testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 477testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 505testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 535testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 565testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 594testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 655testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 674testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 696testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper)); 737testProgram.AppBuilder.Services.AddLogging(b => b.AddXunit(_testOutputHelper));
ManifestGenerationTests.cs (3)
155appBuilder.Services.AddKeyedSingleton<IDistributedApplicationPublisher, JsonDocumentManifestPublisher>("manifest"); 314program.AppBuilder.Services.Configure<PublishingOptions>(options => 544program.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 (2)
Program.cs (1)
7builder.Services.AddHttpClient();
TestResource.cs (1)
12builder.Services.TryAddLifecycleHook<TestResourceLifecycleHook>();
TestProject.AppHost (3)
TestProgram.cs (3)
88AppBuilder.Services.AddHostedService<ResourceLoggerForwarderService>(); 89AppBuilder.Services.AddLifecycleHook<EndPointWriterHook>(); 90AppBuilder.Services.AddHttpClient();