Implemented interface member:
property
Services
Microsoft.Extensions.Hosting.IHostApplicationBuilder.Services
235 references to Services
ApiGateway (1)
Program.cs (1)
4builder.Services.AddReverseProxy()
Aspire.Dashboard (33)
DashboardWebApplication.cs (33)
119builder.Services.AddOptions<DashboardOptions>() 122builder.Services.AddSingleton<IPostConfigureOptions<DashboardOptions>, PostConfigureDashboardOptions>(); 123builder.Services.AddSingleton<IValidateOptions<DashboardOptions>, ValidateDashboardOptions>(); 150builder.Services.Configure<HttpsRedirectionOptions>(options => options.HttpsPort = browserHttpsPort); 153builder.Services.AddSingleton<IPolicyEvaluator, AspirePolicyEvaluator>(); 158builder.Services.AddRazorComponents().AddInteractiveServerComponents(); 159builder.Services.AddCascadingAuthenticationState(); 160builder.Services.AddResponseCompression(options => 169builder.Services.AddCors(options => 202builder.Services.AddScoped<IDashboardClient, DashboardClient>(); 205builder.Services.AddGrpc(); 206builder.Services.AddSingleton<TelemetryRepository>(); 207builder.Services.AddTransient<StructuredLogsViewModel>(); 209builder.Services.AddTransient<OtlpLogsService>(); 210builder.Services.AddTransient<OtlpTraceService>(); 211builder.Services.AddTransient<OtlpMetricsService>(); 213builder.Services.AddTransient<TracesViewModel>(); 214builder.Services.TryAddEnumerable(ServiceDescriptor.Scoped<IOutgoingPeerResolver, ResourceOutgoingPeerResolver>()); 215builder.Services.TryAddEnumerable(ServiceDescriptor.Scoped<IOutgoingPeerResolver, BrowserLinkOutgoingPeerResolver>()); 217builder.Services.AddFluentUIComponents(); 219builder.Services.AddScoped<IEffectiveThemeResolver, BrowserEffectiveThemeResolver>(); 220builder.Services.AddScoped<ThemeManager>(); 222builder.Services.AddScoped<ShortcutManager>(); 223builder.Services.AddSingleton<IInstrumentUnitResolver, DefaultInstrumentUnitResolver>(); 226builder.Services.AddScoped<BrowserTimeProvider>(); 227builder.Services.AddScoped<ILocalStorage, LocalBrowserStorage>(); 228builder.Services.AddScoped<ISessionStorage, SessionBrowserStorage>(); 230builder.Services.AddScoped<IKnownPropertyLookup, KnownPropertyLookup>(); 232builder.Services.AddScoped<DimensionManager>(); 234builder.Services.AddLocalization(); 236builder.Services.AddAntiforgery(options => 617var authentication = builder.Services 744builder.Services.AddAuthorization(options =>
Aspire.Dashboard.Tests (7)
Integration\DashboardClientAuthTests.cs (3)
77serverAppBuilder.Services.AddGrpc(options => options.EnableDetailedErrors = true); 78serverAppBuilder.Services.AddSingleton(testCalls); 79serverAppBuilder.Services.AddSingleton(loggerFactory);
Integration\IntegrationTestHelpers.cs (2)
70builder.Services.PostConfigure<LoggerFilterOptions>(o => 86builder.Services.AddSingleton(loggerFactory);
Integration\Playwright\Infrastructure\DashboardServerFixture.cs (2)
64builder.Services.RemoveAll<IDashboardClient>(); 65builder.Services.AddSingleton<IDashboardClient, MockDashboardClient>();
Aspire.Hosting (14)
Dashboard\DashboardServiceHost.cs (14)
76builder.Services.AddSingleton(configuration); 79builder.Services.AddOptions<ResourceServiceOptions>() 82builder.Services.AddSingleton<IValidateOptions<ResourceServiceOptions>, ValidateResourceServiceOptions>(); 85builder.Services 95builder.Services 105builder.Services.AddSingleton(loggerFactory); 106builder.Services.AddSingleton(loggerOptions); 107builder.Services.Add(ServiceDescriptor.Singleton(typeof(ILogger<>), typeof(Logger<>))); 109builder.Services.AddGrpc(); 110builder.Services.AddSingleton(applicationModel); 111builder.Services.AddSingleton(commandExecutor); 112builder.Services.AddSingleton<DashboardServiceData>(); 113builder.Services.AddSingleton(resourceNotificationService); 114builder.Services.AddSingleton(resourceLoggerService);
BasketService (2)
Program.cs (2)
6builder.Services.AddGrpc(); 9builder.Services.AddTransient<IBasketRepository, RedisBasketRepository>();
BlazorUnitedApp (2)
Program.cs (2)
10builder.Services.AddRazorComponents() 14builder.Services.AddSingleton<WeatherForecastService>();
BrowserTelemetry.Web (1)
Program.cs (1)
8builder.Services.AddRazorPages();
CatalogDb (4)
Program.cs (4)
8builder.Services.AddOpenTelemetry() 11builder.Services.AddSingleton<CatalogDbInitializer>(); 12builder.Services.AddHostedService(sp => sp.GetRequiredService<CatalogDbInitializer>()); 13builder.Services.AddHealthChecks()
CatalogService (3)
Program.cs (3)
9builder.Services.AddEndpointsApiExplorer(); 10builder.Services.AddProblemDetails(); 11builder.Services.AddSwaggerGen();
CdkSample.ApiService (2)
Program.cs (2)
27builder.Services.AddSignalR().AddNamedAzureSignalR("signalr"); 29builder.Services.AddAzureClients(clients =>
CookieSample (1)
Program.cs (1)
11builder.Services
DaprServiceA (3)
Program.cs (3)
13builder.Services.AddEndpointsApiExplorer(); 14builder.Services.AddSwaggerGen(); 16builder.Services.AddDaprClient();
DaprServiceB (3)
Program.cs (3)
12builder.Services.AddEndpointsApiExplorer(); 13builder.Services.AddSwaggerGen(); 15builder.Services.AddDaprClient();
Frontend (4)
Program.cs (4)
12builder.Services.AddAWSService<IAmazonSQS>(); 13builder.Services.AddAWSService<IAmazonSimpleNotificationService>(); 16builder.Services.AddAWSMessageBus(messageBuilder => 27builder.Services.AddRazorComponents()
GetDocumentSample (2)
Program.cs (2)
12builder.Services.AddOpenApi(); 13builder.Services.AddOpenApi("internal");
IdentitySample.ApiEndpoints (3)
Program.cs (3)
15builder.Services.AddAuthorization(); 17builder.Services.AddDbContext<ApplicationDbContext>( 19builder.Services.AddIdentityApiEndpoints<IdentityUser>()
Keycloak.ApiService (3)
Program.cs (3)
7builder.Services.AddProblemDetails(); 9builder.Services.AddAuthentication() 16builder.Services.AddAuthorizationBuilder();
Keycloak.Web (6)
Program.cs (6)
14builder.Services.AddRazorComponents() 17builder.Services.AddOutputCache(); 19builder.Services.AddHttpContextAccessor() 22builder.Services.AddHttpClient<WeatherApiClient>(client => 32builder.Services.AddAuthentication(oidcScheme) 45builder.Services.AddCascadingAuthenticationState();
Microsoft.AspNetCore (2)
WebApplicationBuilder.cs (2)
213Host = new ConfigureHostBuilder(bootstrapHostBuilder.Context, Configuration, Services); 214WebHost = new ConfigureWebHostBuilder(webHostContext, Configuration, Services);
Microsoft.AspNetCore.Authentication.Test (3)
AuthenticationMiddlewareTests.cs (3)
165builder.Services.AddAuthorization(); 166builder.Services.AddAuthentication().AddJwtBearer(); 188builder.Services.AddAuthentication().AddJwtBearer();
Microsoft.AspNetCore.Authorization.Test (2)
AuthorizationMiddlewareTests.cs (2)
981builder.Services.AddAuthorization(); 982builder.Services.AddScoped<IAuthorizationHandler, TestAuthorizationHandler>();
Microsoft.AspNetCore.Diagnostics.Tests (1)
ExceptionHandlerTest.cs (1)
884builder.Services.AddExceptionHandler(o => o.ExceptionHandlingPath = "/handle-errors");
Microsoft.AspNetCore.Identity.FunctionalTests (4)
MapIdentityApiTests.cs (4)
1286builder.Services.AddSingleton(LoggerFactory); 1287builder.Services.AddAuthorization(); 1291builder.Services.AddSingleton(_ => dbConnection); 1294configureServices(builder.Services);
Microsoft.AspNetCore.Mvc.FunctionalTests (12)
AntiforgeryMiddlewareTest.cs (12)
26builder.Services.AddMvcCore().UseSpecificControllers(typeof(TestController)); 27builder.Services.AddAntiforgery(); 58builder.Services.AddMvcCore().UseSpecificControllers(typeof(TestWithBothAttributesController)).AddViews(); 59builder.Services.AddAntiforgery(); 72builder.Services.AddMvcCore().UseSpecificControllers(typeof(TestController)).AddViews(); 73builder.Services.AddAntiforgery(); 99builder.Services.AddMvcCore().UseSpecificControllers(typeof(TestController)); 100builder.Services.AddAntiforgery(); 142builder.Services.AddMvcCore().UseSpecificControllers(typeof(TestController)).AddViews(); 143builder.Services.AddAntiforgery(); 174builder.Services.AddMvcCore().UseSpecificControllers(typeof(TestWithRequestSizeLimitController)); 175builder.Services.AddAntiforgery();
Microsoft.AspNetCore.Rewrite.Tests (5)
MiddlewareTests.cs (5)
884builder.Services.Configure<RewriteOptions>(options => 920builder.Services.Configure<RewriteOptions>(options => 956builder.Services.Configure<RewriteOptions>(options => 993builder.Services.Configure<RewriteOptions>(options => 1030builder.Services.Configure<RewriteOptions>(options =>
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())); 1386var sp = builder.Services.BuildServiceProvider(); 1402builder.Services.AddSingleton<IConfiguration>(builder.Configuration); 1403var sp = builder.Services.BuildServiceProvider(); 1474builder.Services.AddSingleton(builder.Services); 1504builder.Services.AddSingleton(builder.Services); 1531using (var serviceProvider = builder.Services.BuildServiceProvider()) 1550builder.Services.AddSingleton(builder.Services); 1554builder.Services.AddSingleton<IHostLifetime, CustomHostLifetime>(); 1666builder.Services.AddSingleton<IStartupFilter, TerminalMiddlewareStartupFilter>(); 1688builder.Services.AddSingleton<IStartupFilter, UseRoutingStartupFilter>(); 1753Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IConfigureOptions<LoggerFactoryOptions>))); 1755Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IWebHostEnvironment))); 1756Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IOptionsChangeTokenSource<HostFilteringOptions>))); 1757Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IServer))); 1758Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(EndpointDataSource))); 1773Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(IConfigureOptions<LoggerFactoryOptions>)); 1774Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(IOptionsChangeTokenSource<HostFilteringOptions>)); 1775Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(IServer)); 1776Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(EndpointDataSource)); 1779Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IWebHostEnvironment))); 1789builder.Services.AddScoped<Service>(); 1790builder.Services.AddSingleton<Service2>(); 1803builder.Services.AddScoped<Service>(); 1804builder.Services.AddSingleton<Service2>(); 1817Assert.Throws<InvalidOperationException>(() => builder.Services.AddSingleton<IService>(new Service())); 1818Assert.Throws<InvalidOperationException>(() => builder.Services.TryAddSingleton(new Service())); 1819Assert.Throws<InvalidOperationException>(() => builder.Services.AddScoped<IService, Service>()); 1820Assert.Throws<InvalidOperationException>(() => builder.Services.TryAddScoped<IService, Service>()); 1821Assert.Throws<InvalidOperationException>(() => builder.Services.Remove(ServiceDescriptor.Singleton(new Service()))); 1822Assert.Throws<InvalidOperationException>(() => builder.Services[0] = ServiceDescriptor.Singleton(new Service())); 2015builder.Services.AddSingleton<IStartupFilter, PropertyFilter>(); 2051builder.Services.AddSingleton<IStartupFilter, ThrowingStartupFilter>(); 2421Assert.Contains(builder.Services, service => service.ServiceType == typeof(HostBuilderContext)); 2422Assert.Contains(builder.Services, service => service.ServiceType == typeof(IHostApplicationLifetime)); 2423Assert.Contains(builder.Services, service => service.ServiceType == typeof(IHostLifetime)); 2424Assert.Contains(builder.Services, service => service.ServiceType == typeof(IOptions<>)); 2425Assert.Contains(builder.Services, service => service.ServiceType == typeof(ILoggerFactory)); 2426Assert.Contains(builder.Services, service => service.ServiceType == typeof(ILogger<>)); 2439builder.Services.AddAuthorization(); 2440builder.Services.AddAuthentication("testSchemeName") 2479builder.Services.AddAuthorization(); 2480builder.Services.AddAuthentication("testSchemeName") 2525Assert.Same(builder.Services, iHostApplicationBuilder.Services); 2617builder.Services.AddRouting(); 2644builder.Services.AddRoutingCore().Configure<RouteOptions>(options => 2681builder.Services.AddSingleton<IDebugger>(new TestDebugger(true)); 2712builder.Services.AddSingleton<IDebugger>(new TestDebugger(false)); 2733builder.Services.AddAuthenticationCore(); 2734builder.Services.AddAuthorization(); 2735builder.Services.AddSingleton<IDebugger>(new TestDebugger(true)); 2761builder.Services.AddSingleton<IDebugger>(new TestDebugger(true)); 2778builder.Services.AddSingleton<IDebugger>(new TestDebugger(true));
MilvusPlayground.ApiService (1)
Program.cs (1)
11builder.Services.AddProblemDetails();
MinimalFormSample (1)
Program.cs (1)
10builder.Services.AddAntiforgery();
MinimalJwtBearerSample (2)
Program.cs (2)
8builder.Services.AddAuthentication() 13builder.Services.AddAuthorization(options =>
MinimalOpenIdConnectSample (2)
Program.cs (2)
7builder.Services 11builder.Services.AddAuthorization();
MvcFormSample (1)
Program.cs (1)
7builder.Services.AddControllersWithViews();
MyFrontend (4)
Program.cs (4)
9builder.Services.AddHttpForwarderWithServiceDiscovery(); 11builder.Services.AddHttpClient<CatalogServiceClient>(c => c.BaseAddress = new("https+http://catalogservice")); 15builder.Services.AddSingleton<BasketServiceClient>() 18builder.Services.AddRazorComponents();
MySql.ApiService (3)
Program.cs (3)
11builder.Services.AddEndpointsApiExplorer(); 12builder.Services.AddSwaggerGen(); 16builder.Services.AddProblemDetails();
Nats.ApiService (2)
Program.cs (2)
10builder.Services.AddEndpointsApiExplorer(); 11builder.Services.AddSwaggerGen();
Nats.Backend (1)
Program.cs (1)
14builder.Services.AddHostedService<AppEventsBackendService>();
OpenAIEndToEnd.WebStory (1)
Program.cs (1)
13builder.Services.AddRazorComponents()
OutputCachingSample (1)
Startup.cs (1)
9builder.Services.AddOutputCache(options =>
PostgresEndToEnd.ApiService (1)
Program.cs (1)
19builder.Services.AddDbContextPool<MyDb8Context>(dbContextOptionsBuilder => dbContextOptionsBuilder.UseNpgsql(connectionString));
Qdrant.ApiService (1)
Program.cs (1)
10builder.Services.AddProblemDetails();
RateLimitingSample (4)
Program.cs (4)
14builder.Services.AddDbContext<TodoDb>(opt => opt.UseInMemoryDatabase("TodoList")); 15builder.Services.AddDatabaseDeveloperPageExceptionFilter(); 17builder.Services.AddLogging(); 23builder.Services.AddRateLimiter(options =>
Sample (8)
Program.cs (8)
14builder.Services.AddControllers(); 16builder.Services.AddAuthentication().AddJwtBearer(); 18builder.Services.AddOpenApi("v1", options => 23builder.Services.AddOpenApi("v2", options => { 32builder.Services.AddOpenApi("controllers"); 33builder.Services.AddOpenApi("responses"); 34builder.Services.AddOpenApi("forms"); 35builder.Services.AddOpenApi("schemas-by-ref");
SignalRWeb (2)
Program.cs (2)
4builder.Services.AddRazorPages(); 5builder.Services.AddSignalR().AddNamedAzureSignalR("signalr1");
SimpleWebSiteWithWebApplicationBuilder (2)
Program.cs (2)
10builder.Services.AddControllers(); 11builder.Services.AddAntiforgery();
Stress.ApiService (2)
Program.cs (2)
14builder.Services.AddOpenTelemetry() 17builder.Services.AddSingleton<TestMetrics>();
TestingAppHost1.MyWebApp (2)
Program.cs (2)
10builder.Services.AddEndpointsApiExplorer(); 11builder.Services.AddSwaggerGen();
TestProject.IntegrationServiceA (1)
Program.cs (1)
55builder.Services.AddHealthChecks();
WebPubSubWeb (2)
Program.cs (2)
9builder.Services.AddHostedService<NotificationService>(); 12builder.Services.AddRazorPages();