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