5 implementations of ApplicationServices
Microsoft.AspNetCore (1)
WebApplication.cs (1)
71IServiceProvider IApplicationBuilder.ApplicationServices
Microsoft.AspNetCore.Http (1)
Builder\ApplicationBuilder.cs (1)
74public IServiceProvider ApplicationServices
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
MapPathMiddlewareTests.cs (1)
250public IServiceProvider ApplicationServices { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
UsePathBaseExtensionsTests.cs (1)
47public IServiceProvider ApplicationServices
Microsoft.AspNetCore.MiddlewareAnalysis (1)
AnalysisBuilder.cs (1)
30public IServiceProvider ApplicationServices
6 writes to ApplicationServices
Microsoft.AspNetCore.Hosting (1)
Internal\WebHost.cs (1)
211builder.ApplicationServices = _applicationServices;
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
UsePathBaseExtensionsTests.cs (1)
50set { _wrappedBuilder.ApplicationServices = value; }
Microsoft.AspNetCore.MiddlewareAnalysis (1)
AnalysisBuilder.cs (1)
33set { InnerBuilder.ApplicationServices = value; }
Microsoft.AspNetCore.Routing.Tests (3)
RequestDelegateRouteBuilderExtensionsTest.cs (1)
148applicationBuilder.Object.ApplicationServices = services;
RouteTest.cs (1)
1767applicationBuilder.ApplicationServices = services.BuildServiceProvider();
TemplateParserDefaultValuesTests.cs (1)
137applicationBuilder.ApplicationServices = services.BuildServiceProvider();
98 references to ApplicationServices
blazor-devserver (1)
Server\Startup.cs (1)
33var webHostEnvironment = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
CreateDefaultBuilderApp (1)
Program.cs (1)
33var hostingEnvironment = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
CreateDefaultBuilderOfTApp (2)
Program.cs (2)
37var hostFilteringOptions = app.ApplicationServices.GetRequiredService<IOptions<HostFilteringOptions>>(); 44var hostingEnvironment = app.ApplicationServices.GetRequiredService<IHostEnvironment>();
Diagnostics.EFCore.FunctionalTests (2)
DatabaseErrorPageMiddlewareTest.cs (2)
390app.ApplicationServices.GetService<ILoggerFactory>().AddProvider(logProvider); 536app.ApplicationServices.GetService<ILoggerFactory>().AddProvider(logProvider);
InProcessWebSite (1)
src\Servers\IIS\IIS\test\testassets\InProcessWebSite\Startup.WebSockets.cs (1)
65var appLifetime = app.ApplicationServices.GetRequiredService<Microsoft.AspNetCore.Hosting.IApplicationLifetime>();
Microsoft.AspNetCore.Antiforgery (1)
AntiforgeryApplicationBuilderExtensions.cs (1)
34if (builder.ApplicationServices.GetService(typeof(IAntiforgery)) == null)
Microsoft.AspNetCore.Authentication.Negotiate (1)
Internal\NegotiateOptionsValidationStartupFilter.cs (1)
25var options = builder.ApplicationServices.GetRequiredService<IOptionsMonitor<NegotiateOptions>>().Get(_authenticationScheme);
Microsoft.AspNetCore.Authorization.Policy (1)
AuthorizationAppBuilderExtensions.cs (1)
40if (app.ApplicationServices.GetService(typeof(AuthorizationPolicyMarkerService)) == null)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
ComponentsWebAssemblyApplicationBuilderExtensions.cs (1)
38var webHostEnvironment = builder.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
Microsoft.AspNetCore.Diagnostics (6)
ExceptionHandler\ExceptionHandlerExtensions.cs (6)
109var problemDetailsService = app.ApplicationServices.GetService<IProblemDetailsService>(); 118var loggerFactory = app.ApplicationServices.GetRequiredService<ILoggerFactory>(); 119var diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>(); 120var exceptionHandlers = app.ApplicationServices.GetRequiredService<IEnumerable<IExceptionHandler>>(); 121var meterFactory = app.ApplicationServices.GetRequiredService<IMeterFactory>(); 125options = app.ApplicationServices.GetRequiredService<IOptions<ExceptionHandlerOptions>>();
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
Builder\HealthCheckApplicationBuilderExtensions.cs (1)
193if (app.ApplicationServices.GetService(typeof(HealthCheckService)) == null)
Microsoft.AspNetCore.Diagnostics.Tests (4)
DeveloperExceptionPageMiddlewareTest.cs (2)
204diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>(); 548diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();
ExceptionHandlerTest.cs (2)
467diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>(); 520diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();
Microsoft.AspNetCore.HeaderPropagation (1)
DependencyInjection\HeaderPropagationApplicationBuilderExtensions.cs (1)
31if (app.ApplicationServices.GetService<HeaderPropagationValues>() == null)
Microsoft.AspNetCore.Hosting (1)
Internal\ConfigureBuilder.cs (1)
26using (var scope = builder.ApplicationServices.CreateScope())
Microsoft.AspNetCore.Hosting.Tests (7)
StartupManagerTests.cs (2)
743var service = app.ApplicationServices.GetRequiredService<SimpleService>(); 749var service = app.ApplicationServices.GetRequiredService<SimpleService>();
WebHostBuilderTests.cs (5)
225app.ApplicationServices.GetRequiredService<ServiceC>(); 250app.ApplicationServices.GetRequiredService<ServiceC>(); 1067var loggerFactory = app.ApplicationServices.GetService<ILoggerFactory>(); 1244testSink = app.ApplicationServices.GetRequiredService<ITestSink>(); 1658ServiceA = app.ApplicationServices.GetService<ServiceA>();
Microsoft.AspNetCore.Http.Abstractions (2)
Extensions\UseMiddlewareExtensions.cs (2)
131var instance = ActivatorUtilities.CreateInstance(_app.ApplicationServices, _middleware, ctorArgs); 145var serviceProvider = context.RequestServices ?? _app.ApplicationServices;
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
UsePathBaseExtensionsTests.cs (1)
49get { return _wrappedBuilder.ApplicationServices; }
Microsoft.AspNetCore.Http.Extensions.Tests (1)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
484public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
484public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;
Microsoft.AspNetCore.HttpLogging (2)
HttpLoggingBuilderExtensions.cs (2)
48var serviceProviderIsService = app.ApplicationServices.GetService<IServiceProviderIsService>(); 60var serviceProviderIsService = app.ApplicationServices.GetService<IServiceProviderIsService>();
Microsoft.AspNetCore.MiddlewareAnalysis (1)
AnalysisBuilder.cs (1)
32get { return InnerBuilder.ApplicationServices; }
Microsoft.AspNetCore.MiddlewareAnalysis.Tests (1)
MiddlewareAnalysisTests.cs (1)
27diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>();
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1629public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;
Microsoft.AspNetCore.Mvc.Core (7)
Builder\MvcApplicationBuilderExtensions.cs (5)
68var options = app.ApplicationServices.GetRequiredService<IOptions<MvcOptions>>(); 81DefaultHandler = app.ApplicationServices.GetRequiredService<MvcRouteHandler>(), 86routes.Routes.Insert(0, AttributeRouting.CreateAttributeMegaRoute(app.ApplicationServices)); 106get { return ApplicationBuilder.ApplicationServices; } 121if (app.ApplicationServices.GetService(typeof(MvcMarkerService)) == null)
Filters\MiddlewareFilterBuilderStartupFilter.cs (1)
18var middlewarePipelineBuilder = builder.ApplicationServices.GetRequiredService<MiddlewareFilterBuilder>();
Filters\MiddlewareFilterConfigurationProvider.cs (1)
92var serviceProvider = builder.ApplicationServices;
Microsoft.AspNetCore.Mvc.Core.Test (3)
Builder\MvcApplicationBuilderExtensionsTest.cs (1)
20.Setup(s => s.ApplicationServices)
Filters\MiddlewareFilterConfigurationProviderTest.cs (1)
103.SetupGet(a => a.ApplicationServices)
Routing\UrlHelperTest.cs (1)
129.SetupGet(a => a.ApplicationServices)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (1)
RemoteAttributeTest.cs (1)
450.SetupGet(a => a.ApplicationServices)
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentServiceTestsBase.cs (1)
181public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;
Microsoft.AspNetCore.Owin (2)
OwinExtensions.cs (2)
96/// <param name="serviceProvider">A service provider for <see cref="IApplicationBuilder.ApplicationServices"/>.</param> 171/// <param name="serviceProvider">A service provider for <see cref="IApplicationBuilder.ApplicationServices"/>.</param>
Microsoft.AspNetCore.Owin.Tests (3)
OwinExtensionTests.cs (3)
34serviceProvider = applicationBuilder.ApplicationServices; 67serviceProvider = applicationBuilder.ApplicationServices; 101serviceProvider = applicationBuilder.ApplicationServices;
Microsoft.AspNetCore.RateLimiting (1)
RateLimiterApplicationBuilderExtensions.cs (1)
48var serviceProviderIsService = app.ApplicationServices.GetService<IServiceProviderIsService>();
Microsoft.AspNetCore.Rewrite (3)
RewriteBuilderExtensions.cs (3)
54options = app.ApplicationServices.GetRequiredService<IOptions<RewriteOptions>>(); 57var webHostEnv = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>(); 58var loggerFactory = app.ApplicationServices.GetRequiredService<ILoggerFactory>();
Microsoft.AspNetCore.Routing (7)
Builder\EndpointRoutingApplicationBuilderExtensions.cs (2)
104var routeOptions = builder.ApplicationServices.GetRequiredService<IOptions<RouteOptions>>(); 120if (app.ApplicationServices.GetService(typeof(RoutingMarkerService)) == null)
Builder\RoutingBuilderExtensions.cs (2)
25if (builder.ApplicationServices.GetService(typeof(RoutingMarkerService)) == null) 48if (builder.ApplicationServices.GetService(typeof(RoutingMarkerService)) == null)
DefaultEndpointRouteBuilder.cs (1)
22public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices;
RouteBuilder.cs (2)
35if (applicationBuilder.ApplicationServices.GetService(typeof(RoutingMarkerService)) == null) 45ServiceProvider = applicationBuilder.ApplicationServices;
Microsoft.AspNetCore.Routing.Tests (3)
Builder\RoutingBuilderExtensionsTest.cs (1)
19.Setup(s => s.ApplicationServices)
RouteBuilderTest.cs (2)
20applicationBuilderMock.Setup(a => a.ApplicationServices).Returns(applicationServices); 39.Setup(s => s.ApplicationServices)
Microsoft.AspNetCore.Server.IIS (1)
Core\IISServerSetupFilter.cs (1)
17var server = app.ApplicationServices.GetService<IServer>();
Microsoft.AspNetCore.Server.IISIntegration.Tests (4)
IISMiddlewareTests.cs (4)
117var appLifetime = app.ApplicationServices.GetRequiredService<IHostApplicationLifetime>(); 176var appLifetime = app.ApplicationServices.GetRequiredService<IHostApplicationLifetime>(); 221var appLifetime = app.ApplicationServices.GetRequiredService<IHostApplicationLifetime>(); 266var appLifetime = app.ApplicationServices.GetRequiredService<IHostApplicationLifetime>();
Microsoft.AspNetCore.SpaServices.Extensions (10)
AngularCli\AngularCliBuilder.cs (2)
49var applicationStoppingToken = appBuilder.ApplicationServices.GetRequiredService<IHostApplicationLifetime>().ApplicationStopping; 53var diagnosticSource = appBuilder.ApplicationServices.GetRequiredService<DiagnosticSource>();
AngularCli\AngularCliMiddleware.cs (2)
38var applicationStoppingToken = appBuilder.ApplicationServices.GetRequiredService<IHostApplicationLifetime>().ApplicationStopping; 40var diagnosticSource = appBuilder.ApplicationServices.GetRequiredService<DiagnosticSource>();
Proxying\SpaProxyingExtensions.cs (1)
85.ApplicationServices
ReactDevelopmentServer\ReactDevelopmentServerMiddleware.cs (2)
38var applicationStoppingToken = appBuilder.ApplicationServices.GetRequiredService<IHostApplicationLifetime>().ApplicationStopping; 40var diagnosticSource = appBuilder.ApplicationServices.GetRequiredService<DiagnosticSource>();
SpaApplicationBuilderExtensions.cs (1)
34var optionsProvider = app.ApplicationServices.GetService<IOptions<SpaOptions>>()!;
StaticFiles\SpaStaticFilesExtensions.cs (1)
110var spaStaticFilesService = app.ApplicationServices.GetService<ISpaStaticFileProvider>();
Util\LoggerFinder.cs (1)
18var loggerFactory = appBuilder.ApplicationServices.GetService<ILoggerFactory>();
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
SpaServicesExtensionsTests.cs (1)
50.Setup(s => s.ApplicationServices)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
FallbackStaticFileTest.cs (1)
37var environment = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
Microsoft.AspNetCore.TestHost.Tests (8)
TestServerTests.cs (8)
241var applicationServices = app.ApplicationServices; 562var logger = app.ApplicationServices.GetRequiredService<ILogger<HttpContext>>(); 579var accessor = app.ApplicationServices.GetRequiredService<IHttpContextAccessor>(); 610var accessor = app.ApplicationServices.GetRequiredService<ContextHolder>(); 728diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>(); 755diagnosticListener = app.ApplicationServices.GetRequiredService<DiagnosticListener>(); 905var service = app.ApplicationServices.GetRequiredService<SimpleService>(); 914var service = app.ApplicationServices.GetService<SimpleService>();
SocialWeather (1)
Startup.cs (1)
38var formatterResolver = app.ApplicationServices.GetRequiredService<FormatterResolver>();