Implemented interface member:

property
Services
Microsoft.Extensions.Hosting.IHostApplicationBuilder.Services
263 references to Services
ApiGateway (1)
Aspire.Dashboard (42)
DashboardWebApplication.cs (42)
159builder.Services.AddOptions<DashboardOptions>()
162builder.Services.AddSingleton<IPostConfigureOptions<DashboardOptions>, PostConfigureDashboardOptions>();
163builder.Services.AddSingleton<IValidateOptions<DashboardOptions>, ValidateDashboardOptions>();
191builder.Services.Configure<HttpsRedirectionOptions>(options => options.HttpsPort = browserHttpsPort);
194builder.Services.AddSingleton<IPolicyEvaluator, AspirePolicyEvaluator>();
199builder.Services.AddRazorComponents().AddInteractiveServerComponents();
200builder.Services.AddCascadingAuthenticationState();
201builder.Services.AddResponseCompression(options =>
208builder.Services.AddHealthChecks();
211builder.Services.AddCors(options =>
238builder.Services.Configure<ForwardedHeadersOptions>(options =>
250builder.Services.TryAddSingleton<IDashboardClient, DashboardClient>();
251builder.Services.TryAddScoped<DashboardCommandExecutor>();
253builder.Services.AddSingleton<PauseManager>();
256builder.Services.TryAddScoped<ComponentTelemetryContextProvider>();
257builder.Services.TryAddSingleton<DashboardTelemetryService>();
258builder.Services.TryAddSingleton<IDashboardTelemetrySender, DashboardTelemetrySender>();
259builder.Services.AddSingleton<ILoggerProvider, TelemetryLoggerProvider>();
262builder.Services.AddGrpc();
263builder.Services.AddSingleton<TelemetryRepository>();
264builder.Services.AddTransient<StructuredLogsViewModel>();
266builder.Services.AddTransient<OtlpLogsService>();
267builder.Services.AddTransient<OtlpTraceService>();
268builder.Services.AddTransient<OtlpMetricsService>();
270builder.Services.AddTransient<TracesViewModel>();
271builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IOutgoingPeerResolver, ResourceOutgoingPeerResolver>());
272builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IOutgoingPeerResolver, BrowserLinkOutgoingPeerResolver>());
274builder.Services.AddFluentUIComponents();
276builder.Services.AddScoped<IThemeResolver, BrowserThemeResolver>();
277builder.Services.AddScoped<ThemeManager>();
279builder.Services.AddScoped<ShortcutManager>();
280builder.Services.AddScoped<ConsoleLogsManager>();
281builder.Services.AddSingleton<IInstrumentUnitResolver, DefaultInstrumentUnitResolver>();
284builder.Services.AddScoped<BrowserTimeProvider>();
285builder.Services.AddScoped<ILocalStorage, LocalBrowserStorage>();
286builder.Services.AddScoped<ISessionStorage, SessionBrowserStorage>();
288builder.Services.AddSingleton<IKnownPropertyLookup, KnownPropertyLookup>();
290builder.Services.AddScoped<DimensionManager>();
292builder.Services.AddLocalization();
294builder.Services.AddAntiforgery(options =>
689var authentication = builder.Services
816builder.Services.AddAuthorization(options =>
Aspire.Dashboard.Tests (7)
Aspire.Hosting (15)
AzureAIFoundryEndToEnd.WebStory (1)
AzureOpenAIEndToEnd.WebStory (1)
BasketService (2)
BlazorUnitedApp (2)
BrowserTelemetry.Web (1)
CatalogDb (4)
CatalogService (1)
CdkSample.ApiService (2)
CookieSample (1)
DatabaseMigration.ApiService (1)
GetDocumentSample (2)
GitHubModelsEndToEnd.WebStory (1)
IdentitySample.ApiEndpoints (3)
IdentitySample.PasskeyConformance (4)
IdentitySample.PasskeyUI (8)
Keycloak.ApiService (3)
Keycloak.Web (6)
Microsoft.AspNetCore (2)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (3)
Microsoft.AspNetCore.Authentication.Test (3)
Microsoft.AspNetCore.Authorization.Test (2)
Microsoft.AspNetCore.Diagnostics.Tests (1)
Microsoft.AspNetCore.Identity.FunctionalTests (4)
Microsoft.AspNetCore.Mvc.FunctionalTests (12)
Microsoft.AspNetCore.OpenApi (4)
Microsoft.AspNetCore.Rewrite.Tests (5)
Microsoft.AspNetCore.Tests (68)
WebApplicationTests.cs (68)
54builder.Services.AddRoutingCore();
84builder.Services.AddRoutingCore();
114builder.Services.AddRoutingCore();
180builder.Services.AddSingleton<IServer>(server);
201builder.Services.AddSingleton<IServer>(server);
220builder.Services.AddSingleton<IServer>(server);
239builder.Services.AddSingleton<IServer>(server);
259builder.Services.AddSingleton<IServer>(server);
279builder.Services.AddSingleton<IServer>(new MockAddressesServer());
293builder.Services.AddSingleton<IHostedService>(hostedService);
294builder.Services.AddSingleton<IServer>(server);
352builder.Services.AddSingleton<IServer>(new MockAddressesServer());
363builder.Services.AddSingleton<IServer>(new MockAddressesServer(new List<string>().AsReadOnly()));
1388var sp = builder.Services.BuildServiceProvider();
1404builder.Services.AddSingleton<IConfiguration>(builder.Configuration);
1405var sp = builder.Services.BuildServiceProvider();
1476builder.Services.AddSingleton(builder.Services);
1506builder.Services.AddSingleton(builder.Services);
1533using (var serviceProvider = builder.Services.BuildServiceProvider())
1552builder.Services.AddSingleton(builder.Services);
1556builder.Services.AddSingleton<IHostLifetime, CustomHostLifetime>();
1668builder.Services.AddSingleton<IStartupFilter, TerminalMiddlewareStartupFilter>();
1690builder.Services.AddSingleton<IStartupFilter, UseRoutingStartupFilter>();
1755Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IConfigureOptions<LoggerFactoryOptions>)));
1757Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IWebHostEnvironment)));
1758Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IOptionsChangeTokenSource<HostFilteringOptions>)));
1759Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IServer)));
1760Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(EndpointDataSource)));
1775Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(IConfigureOptions<LoggerFactoryOptions>));
1776Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(IOptionsChangeTokenSource<HostFilteringOptions>));
1777Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(IServer));
1778Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(EndpointDataSource));
1781Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IWebHostEnvironment)));
1791builder.Services.AddScoped<Service>();
1792builder.Services.AddSingleton<Service2>();
1805builder.Services.AddScoped<Service>();
1806builder.Services.AddSingleton<Service2>();
1819Assert.Throws<InvalidOperationException>(() => builder.Services.AddSingleton<IService>(new Service()));
1820Assert.Throws<InvalidOperationException>(() => builder.Services.TryAddSingleton(new Service()));
1821Assert.Throws<InvalidOperationException>(() => builder.Services.AddScoped<IService, Service>());
1822Assert.Throws<InvalidOperationException>(() => builder.Services.TryAddScoped<IService, Service>());
1823Assert.Throws<InvalidOperationException>(() => builder.Services.Remove(ServiceDescriptor.Singleton(new Service())));
1824Assert.Throws<InvalidOperationException>(() => builder.Services[0] = ServiceDescriptor.Singleton(new Service()));
2017builder.Services.AddSingleton<IStartupFilter, PropertyFilter>();
2053builder.Services.AddSingleton<IStartupFilter, ThrowingStartupFilter>();
2423Assert.Contains(builder.Services, service => service.ServiceType == typeof(HostBuilderContext));
2424Assert.Contains(builder.Services, service => service.ServiceType == typeof(IHostApplicationLifetime));
2425Assert.Contains(builder.Services, service => service.ServiceType == typeof(IHostLifetime));
2426Assert.Contains(builder.Services, service => service.ServiceType == typeof(IOptions<>));
2427Assert.Contains(builder.Services, service => service.ServiceType == typeof(ILoggerFactory));
2428Assert.Contains(builder.Services, service => service.ServiceType == typeof(ILogger<>));
2441builder.Services.AddAuthorization();
2442builder.Services.AddAuthentication("testSchemeName")
2481builder.Services.AddAuthorization();
2482builder.Services.AddAuthentication("testSchemeName")
2527Assert.Same(builder.Services, iHostApplicationBuilder.Services);
2619builder.Services.AddRouting();
2646builder.Services.AddRoutingCore().Configure<RouteOptions>(options =>
2683builder.Services.AddSingleton<IDebugger>(new TestDebugger(true));
2714builder.Services.AddSingleton<IDebugger>(new TestDebugger(false));
2735builder.Services.AddAuthenticationCore();
2736builder.Services.AddAuthorization();
2737builder.Services.AddSingleton<IDebugger>(new TestDebugger(true));
2763builder.Services.AddSingleton<IDebugger>(new TestDebugger(true));
2780builder.Services.AddSingleton<IDebugger>(new TestDebugger(true));
MilvusPlayground.ApiService (1)
MinimalFormSample (1)
MinimalJwtBearerSample (2)
MinimalOpenIdConnectSample (2)
MinimalValidationSample (1)
MvcFormSample (1)
MyFrontend (4)
MySql.ApiService (1)
Nats.Backend (1)
OpenAIEndToEnd.WebStory (1)
OutputCachingSample (1)
Publishers.Frontend (2)
Qdrant.ApiService (1)
RateLimitingSample (4)
Sample (11)
SignalRServerlessWeb (2)
SignalRWeb (2)
SimpleWebSiteWithWebApplicationBuilder (2)
Stress.ApiService (2)
TestProject.IntegrationServiceA (1)
WaitFor.Frontend (2)
WebFrontEnd (4)
WebPubSubWeb (2)