1 instantiation of ServiceProvider
Microsoft.Extensions.DependencyInjection (1)
ServiceCollectionContainerBuilderExtensions.cs (1)
57return new ServiceProvider(services, options);
769 references to ServiceProvider
Aspire.Playground.Tests (1)
Infrastructure\DistributedApplicationExtensions.cs (1)
196var services = new ServiceCollection()
CustomEncryptorSample (1)
Program.cs (1)
15using (var services = new ServiceCollection()
EntityFrameworkCoreSample (1)
Program.cs (1)
17var services = new ServiceCollection()
InteropClient (1)
InteropClient.cs (1)
83private ServiceProvider serviceProvider;
KeyManagementSample (1)
Program.cs (1)
26using (var services = serviceCollection.BuildServiceProvider())
Microsoft.Arcade.Common (3)
MSBuildTaskBase.cs (3)
34using (var provider = collection.BuildServiceProvider()) 49public bool InvokeExecute(ServiceProvider provider) 79private object[] GetExecuteArguments(ServiceProvider serviceProvider)
Microsoft.AspNetCore.Antiforgery.Test (3)
AntiforgeryApplicationBuilderExtensionsTest.cs (1)
57var serviceProvider = services.BuildServiceProvider();
AntiforgeryOptionsSetupTest.cs (2)
27var services = serviceCollection.BuildServiceProvider(); 52var services = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.AsyncState.Tests (1)
AsyncContextHttpContextOfTTests.cs (1)
24var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Authentication.Core.Test (25)
AuthenticationSchemeProviderTests.cs (12)
17var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 30var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 43var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 59var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 77var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 93var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 109var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 134var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 147var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 161var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 178var services = new ServiceCollection().AddOptions() 197var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o =>
AuthenticationServiceTests.cs (13)
15var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 31var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 54var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 69var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 84var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 98var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 113var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 136var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 157var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 177var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 195var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 213var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o => 232var services = new ServiceCollection().AddOptions().AddAuthenticationCore(o =>
Microsoft.AspNetCore.Authentication.Test (39)
AuthenticationMiddlewareTests.cs (1)
216var serviceProvider = serviceCollection.BuildServiceProvider();
CertificateTests.cs (1)
31var sp = services.BuildServiceProvider();
JwtBearerTests_Handler.cs (5)
973var sp = services.BuildServiceProvider(); 1010var sp = services.BuildServiceProvider(); 1037var sp = services.BuildServiceProvider(); 1057var sp = services.BuildServiceProvider(); 1079var sp = services.BuildServiceProvider();
OpenIdConnect\OpenIdConnectConfigurationTests.cs (9)
46var sp = services.BuildServiceProvider(); 93var sp = services.BuildServiceProvider(); 122var sp = services.BuildServiceProvider(); 162var sp = services.BuildServiceProvider(); 202var sp = services.BuildServiceProvider(); 242var sp = services.BuildServiceProvider(); 285var sp = services.BuildServiceProvider(); 340var sp = services.BuildServiceProvider(); 400var sp = services.BuildServiceProvider();
OpenIdConnect\OpenIdConnectTests.cs (5)
440var sp = services.BuildServiceProvider(); 473var sp = services.BuildServiceProvider(); 508var sp = services.BuildServiceProvider(); 531var sp = services.BuildServiceProvider(); 559var sp = services.BuildServiceProvider();
PolicyTests.cs (5)
74var sp = services.BuildServiceProvider(); 130var sp = services.BuildServiceProvider(); 191var sp = services.BuildServiceProvider(); 243var sp = services.BuildServiceProvider(); 300var sp = services.BuildServiceProvider();
SharedAuthenticationTests.cs (11)
41var sp = services.BuildServiceProvider(); 105var sp = services.BuildServiceProvider(); 147var sp = services.BuildServiceProvider(); 187var sp = services.BuildServiceProvider(); 237var sp = services.BuildServiceProvider(); 266var sp = services.BuildServiceProvider(); 305var sp = services.BuildServiceProvider(); 347var sp = services.BuildServiceProvider(); 416var sp = services.BuildServiceProvider(); 490var sp = services.BuildServiceProvider(); 541var sp = services.BuildServiceProvider();
WsFederation\WsFederationTest.cs (1)
32var sp = services.BuildServiceProvider();
WsFederation\WsFederationTest_Handler.cs (1)
30var sp = services.BuildServiceProvider();
Microsoft.AspNetCore.Authorization.Test (6)
AuthorizationAppBuilderExtensionsTests.cs (1)
73var serviceProvder = services.BuildServiceProvider();
AuthorizationMiddlewareResultHandlerTests.cs (1)
140var serviceProvider = services.BuildServiceProvider();
AuthorizationMiddlewareTests.cs (4)
251var services = new ServiceCollection() 291var services = new ServiceCollection() 360var services = new ServiceCollection() 1044var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Components.Authorization.Tests (1)
AuthorizeRouteViewTest.cs (1)
36var services = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
EndpointHtmlRendererTest.cs (1)
670var provider = collection.BuildServiceProvider();
ImportMapTest.cs (1)
24var serviceProvider = services.BuildServiceProvider();
RazorComponentEndpointInvokerTest.cs (1)
21var services = new ServiceCollection().AddRazorComponents()
RazorComponentsServiceCollectionExtensionsTest.cs (1)
118var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Components.Server.Tests (1)
ComponentEndpointRouteBuilderExtensionsTest.cs (1)
143var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Components.Tests (5)
OwningComponentBaseTest.cs (1)
17var serviceProvider = services.BuildServiceProvider();
RouteViewTest.cs (1)
23var services = serviceCollection.BuildServiceProvider();
Routing\RouterTest.cs (1)
27var serviceProvider = services.BuildServiceProvider();
Routing\RouteTableFactoryTests.cs (2)
14private readonly ServiceProvider _serviceProvider; 1120private readonly ServiceProvider _serviceProvider;
Microsoft.AspNetCore.Components.Web.Tests (5)
Forms\Mapping\FormMappingScopeTest.cs (1)
20var services = serviceCollection.BuildServiceProvider();
Virtualization\VirtualizeTest.cs (4)
23var serviceProvider = new ServiceCollection() 42var serviceProvider = new ServiceCollection() 61var serviceProvider = new ServiceCollection() 82var serviceProvider = new ServiceCollection()
Microsoft.AspNetCore.Components.WebView.Test (5)
WebViewManagerTests.cs (5)
14var services = RegisterTestServices().AddTestBlazorWebView().BuildServiceProvider(); 34var services = RegisterTestServices().AddTestBlazorWebView().BuildServiceProvider(); 56var services = RegisterTestServices().AddTestBlazorWebView().BuildServiceProvider(); 84var services = RegisterTestServices() 102var services = RegisterTestServices().AddTestBlazorWebView().BuildServiceProvider();
Microsoft.AspNetCore.DataProtection.Tests (25)
ActivatorTests.cs (1)
17var services = serviceCollection.BuildServiceProvider();
DataProtectionUtilityExtensionsTests.cs (4)
33var services = new ServiceCollection() 64var services = new ServiceCollection() 91var services = new ServiceCollection() 116var services = new ServiceCollection()
KeyManagement\KeyEscrowServiceProviderExtensionsTests.cs (3)
23var services = new ServiceCollection().BuildServiceProvider(); 44var services = serviceCollection.BuildServiceProvider(); 77var services = serviceCollection.BuildServiceProvider();
ServiceCollectionTests.cs (6)
21var services = new ServiceCollection() 32var services1 = new ServiceCollection() 38var services2 = new ServiceCollection() 55var services = serviceCollection.BuildServiceProvider(validateScopes: true); 81var services = new ServiceCollection() 114var services = new ServiceCollection()
TypeForwardingActivatorTests.cs (2)
16var services = serviceCollection.BuildServiceProvider(); 33var services = serviceCollection.BuildServiceProvider();
XmlEncryption\CertificateXmlEncryptionTests.cs (1)
41var services = serviceCollection.BuildServiceProvider();
XmlEncryption\EncryptedXmlDecryptorTests.cs (3)
34var services = new ServiceCollection() 52var services = new ServiceCollection() 70var services = new ServiceCollection()
XmlEncryption\XmlEncryptionExtensionsTests.cs (5)
42var services = serviceCollection.BuildServiceProvider(); 69var services = serviceCollection.BuildServiceProvider(); 103var services = serviceCollection.BuildServiceProvider(); 135var services = serviceCollection.BuildServiceProvider(); 186var services = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (12)
Latency\AddServerTimingHeaderMiddlewareTests.cs (1)
29using var serviceProvider = new ServiceCollection()
Latency\RequestLatencyTelemetryExtensionsTests.cs (2)
33using var serviceProvider = new ServiceCollection() 58using var serviceProvider = new ServiceCollection()
Logging\HttpLoggingServiceExtensionsTests.cs (2)
45using var provider = services.BuildServiceProvider(); 77using var provider = services.BuildServiceProvider();
Logging\HttpUtilityExtensionsTests.cs (1)
27var sp = new ServiceCollection().AddHttpRouteUtilities().BuildServiceProvider();
Logging\LoggingOptionsValidationTests.cs (3)
22using var services = new ServiceCollection() 38using var services = new ServiceCollection() 54using var services = new ServiceCollection()
Logging\RequestHeadersEnricherExtensionsTests.cs (3)
31using var sp = new ServiceCollection() 42using var serviceProvider = new ServiceCollection() 55using var serviceProvider = new ServiceCollection()
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (4)
GrpcJsonTranscodingServiceExtensionsTests.cs (2)
21var serviceProvider = services.BuildServiceProvider(); 46var serviceProvider = services.BuildServiceProvider();
Infrastructure\TestHelpers.cs (1)
25var serviceProvider = serviceCollection.BuildServiceProvider();
JsonTranscodingServerCallContextTests.cs (1)
62var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Grpc.Swagger.Tests (3)
GrpcSwaggerServiceExtensionsTests.cs (2)
31var serviceProvider = services.BuildServiceProvider(); 67var serviceProvider = services.BuildServiceProvider();
Infrastructure\OpenApiTestHelpers.cs (1)
31var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.HeaderParsing.Tests (4)
HeaderParsingExtensionsTests.cs (4)
21using var services = new ServiceCollection() 33using var services = new ServiceCollection() 43using var services = new ServiceCollection() 53using var services = new ServiceCollection()
Microsoft.AspNetCore.HeaderPropagation.Tests (1)
HeaderPropagationIntegrationTest.cs (1)
86var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Hosting (1)
WebHostBuilder.cs (1)
200var provider = collection.BuildServiceProvider();
Microsoft.AspNetCore.Hosting.Tests (37)
ConfigureBuilderTests.cs (1)
18var services = new ServiceCollection()
Http\DefaultHttpContextFactoryTests.cs (6)
15var services = new ServiceCollection() 33var services = new ServiceCollection() 55var services = new ServiceCollection() 69var services = new ServiceCollection() 87var services = new ServiceCollection() 105var services = new ServiceCollection()
StartupManagerTests.cs (27)
25var services = serviceCollection.BuildServiceProvider(); 47var services = serviceCollection.BuildServiceProvider(); 68var services = serviceCollection.BuildServiceProvider(); 93var services = serviceCollection.BuildServiceProvider(); 115var services = serviceCollection.BuildServiceProvider(); 137var services = serviceCollection.BuildServiceProvider(); 295var services = serviceCollection.BuildServiceProvider(); 317var services = serviceCollection.BuildServiceProvider(); 343var services = new ServiceCollection() 365var services = serviceCollection.BuildServiceProvider(); 390var services = new ServiceCollection() 412var services = serviceCollection.BuildServiceProvider(); 426var services = serviceCollection.BuildServiceProvider(); 441var services = serviceCollection.BuildServiceProvider(); 454var services = serviceCollection.BuildServiceProvider(); 471var services = serviceCollection.BuildServiceProvider(); 489var services = serviceCollection.BuildServiceProvider(); 507var services = serviceCollection.BuildServiceProvider(); 522var services = serviceCollection.BuildServiceProvider(); 536var services = serviceCollection.BuildServiceProvider(); 551var services = serviceCollection.BuildServiceProvider(); 567var services = serviceCollection.BuildServiceProvider(); 583var services = serviceCollection.BuildServiceProvider(); 598var services = serviceCollection.BuildServiceProvider(); 609var services = serviceCollection.BuildServiceProvider(); 619var services = serviceCollection.BuildServiceProvider(); 629var services = serviceCollection.BuildServiceProvider();
WebHostBuilderTests.cs (1)
1618var provider = containerBuilder.BuildServiceProvider();
WebHostTests.AsyncDisposable.cs (2)
63private readonly ServiceProvider _serviceProvider; 65public AsyncDisposableServiceProvider(ServiceProvider serviceProvider)
Microsoft.AspNetCore.Http.Connections.Tests (3)
HttpConnectionDispatcherTests.cs (3)
1838var sp = services.BuildServiceProvider(); 1890var sp = services.BuildServiceProvider(); 2024var services = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Http.Extensions (1)
RequestDelegateFactoryContext.cs (1)
16public required IServiceProvider ServiceProvider { get; init; }
Microsoft.AspNetCore.Http.Extensions.Tests (53)
ProblemDetailsServiceCollectionExtensionsTest.cs (6)
97var services = collection.BuildServiceProvider(); 122var services = collection.BuildServiceProvider(); 162var services = collection.BuildServiceProvider(); 183var services = collection.BuildServiceProvider(); 203var services = collection.BuildServiceProvider(); 228var services = collection.BuildServiceProvider();
RequestDelegateFactoryTests.cs (4)
1177var services = serviceCollection.BuildServiceProvider(); 1744var services = serviceCollection.BuildServiceProvider(); 3019var serviceProvider = new ServiceCollection().AddSingleton(metadataService).BuildServiceProvider(); 3034var serviceProvider = new ServiceCollection().AddSingleton(metadataService).BuildServiceProvider();
RequestDelegateGenerator\CompileTimeCreationTests.cs (1)
424var serviceProvider = CreateServiceProvider(serviceCollection =>
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
208public ServiceProvider CreateServiceProvider(Action<IServiceCollection> configureServices = null)
RequestDelegateGenerator\RequestDelegateCreationTests.cs (4)
272var services = serviceCollection.BuildServiceProvider(); 301var services = serviceCollection.BuildServiceProvider(); 302var emptyServices = new ServiceCollection().BuildServiceProvider(); 613var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.AddSingleton<global::Http.ExampleService>());
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (3)
921var serviceProvider = CreateServiceProvider(serviceCollection => 958var serviceProvider = CreateServiceProvider(); 992var serviceProvider = CreateServiceProvider(serviceCollection =>
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBodyOrService.cs (5)
48var serviceProvider = CreateServiceProvider(hasService ? 78var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.AddSingleton(new TestService())); 119var serviceProvider = CreateServiceProvider(); 191var serviceProvider = CreateServiceProvider(serviceCollection => 214var serviceProvider = CreateServiceProvider((serviceCollection) =>
RequestDelegateGenerator\RequestDelegateCreationTests.KeyServices.cs (8)
22var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.AddKeyedSingleton("service1", myOriginalService)); 38var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.AddKeyedSingleton("service1", myOriginalService)); 64var serviceProvider = CreateServiceProvider((serviceCollection) => 88var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.AddKeyedSingleton('a', myOriginalService)); 108var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.AddKeyedSingleton(key, myOriginalService)); 161var serviceProvider = CreateServiceProvider((serviceCollection) => 189var serviceProvider = CreateServiceProvider((serviceCollection) => 239var serviceProvider = CreateServiceProvider((serviceCollection) => serviceCollection.AddKeyedSingleton<global::Http.ExampleService>("example"));
RequestDelegateGenerator\RequestDelegateCreationTests.Logging.cs (15)
32var serviceProvider = CreateServiceProvider(); 94var serviceProvider = CreateServiceProvider(); 142var serviceProvider = CreateServiceProvider(serviceCollection => 179var serviceProvider = CreateServiceProvider(serviceCollection => 216var serviceProvider = CreateServiceProvider(); 260var serviceProvider = CreateServiceProvider(serviceCollection => 296var serviceProvider = CreateServiceProvider(); 340var serviceProvider = CreateServiceProvider(serviceCollection => 377var serviceProvider = CreateServiceProvider(serviceCollection => 423var serviceProvider = CreateServiceProvider(serviceCollection => 472var serviceProvider = CreateServiceProvider(serviceCollection => 509var serviceProvider = CreateServiceProvider(serviceCollection => 550var serviceProvider = CreateServiceProvider(serviceCollection => 590var serviceProvider = CreateServiceProvider(serviceCollection => 630var serviceProvider = CreateServiceProvider(serviceCollection =>
RequestDelegateGenerator\RequestDelegateCreationTests.Metadata.cs (2)
358var serviceProvider = CreateServiceProvider((services) => 378var serviceProvider = CreateServiceProvider((services) =>
RequestDelegateGenerator\RequestDelegateCreationTests.QueryParameters.cs (1)
45var serviceProvider = CreateServiceProvider();
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (3)
305var serviceProvider = CreateServiceProvider(serviceCollection => 343var serviceProvider = CreateServiceProvider(serviceCollection => 378var serviceProvider = CreateServiceProvider(serviceCollection =>
Microsoft.AspNetCore.Http.Microbenchmarks (1)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (1)
208public ServiceProvider CreateServiceProvider(Action<IServiceCollection> configureServices = null)
Microsoft.AspNetCore.Http.Results.Tests (2)
ProblemResultTests.cs (1)
52var services = CreateServiceCollection()
ValidationProblemResultTests.cs (1)
56var services = CreateServiceCollection()
Microsoft.AspNetCore.Http.Tests (6)
ApplicationBuilderTests.cs (2)
84var serviceProvider = services.BuildServiceProvider(); 110var serviceProvider = services.BuildServiceProvider();
DefaultHttpContextTests.cs (4)
191var serviceProvider = new ServiceCollection() 206var serviceProvider = new ServiceCollection() 512private readonly ServiceProvider _serviceProvider; 514public AsyncDisposableServiceProvider(ServiceProvider serviceProvider)
Microsoft.AspNetCore.HttpLogging.Tests (3)
HttpLoggingServicesExtensionsTests.cs (3)
29var serviceProvider = services.BuildServiceProvider(); 41var serviceProvider = services.BuildServiceProvider(); 55var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (11)
DbUtil.cs (1)
38var serviceProvider = ConfigureDbServices<TContext>(connection, services).BuildServiceProvider();
DefaultPocoTest.cs (1)
32var provider = services.BuildServiceProvider();
UserOnlyCustomContextTest.cs (1)
76var provider = services.BuildServiceProvider();
UserOnlyTest.cs (1)
37var provider = services.BuildServiceProvider();
UserStoreEncryptPersonalDataTest.cs (1)
192var applicationServiceProvider = services.BuildServiceProvider();
UserStoreGuidKeyTest.cs (2)
63var sp = services.BuildServiceProvider(); 80var sp = services.BuildServiceProvider();
UserStoreIntKeyTest.cs (2)
41var sp = services.BuildServiceProvider(); 58var sp = services.BuildServiceProvider();
UserStoreStringKeyTest.cs (2)
42var sp = services.BuildServiceProvider(); 59var sp = services.BuildServiceProvider();
Microsoft.AspNetCore.Identity.Test (10)
IdentityBuilderTest.cs (6)
21var sp = services.BuildServiceProvider(); 47var sp = services.BuildServiceProvider(); 185var provider = services.BuildServiceProvider(); 210var provider = services.BuildServiceProvider(); 230var provider = services.BuildServiceProvider(); 245var provider = services.BuildServiceProvider();
IdentityOptionsTest.cs (3)
42var serviceProvider = services.BuildServiceProvider(); 62var serviceProvider = services.BuildServiceProvider(); 82var serviceProvider = services.BuildServiceProvider();
UserManagerTest.cs (1)
43var provider = services.BuildServiceProvider();
Microsoft.AspNetCore.InternalTesting (1)
AssemblyTestLog.cs (1)
209var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1536var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.Core.Test (23)
ApplicationModels\EndpointMetadataProviderTest.cs (1)
273var serviceProvider = services.BuildServiceProvider();
Authorization\AuthorizeFilterTest.cs (3)
469var serviceProvider = new ServiceCollection() 497var serviceProvider = new ServiceCollection() 608var serviceProvider = serviceCollection.BuildServiceProvider();
Builder\MvcApplicationBuilderExtensionsTest.cs (2)
42var serviceProvider = services.BuildServiceProvider(); 67var serviceProvider = services.BuildServiceProvider();
Controllers\ControllerActivatorProviderTest.cs (1)
49var serviceProvider = new ServiceCollection()
FileResultHelperTest.cs (1)
78var provider = new ServiceCollection()
Filters\MiddlewareFilterAttributeTest.cs (1)
18var serviceProvider = services.BuildServiceProvider();
Filters\MiddlewareFilterConfigurationProviderTest.cs (1)
99var serviceProvider = services.BuildServiceProvider();
Infrastructure\ActionSelectorTest.cs (1)
1102var serviceProvider = new ServiceCollection().BuildServiceProvider();
ModelBinding\Binders\BinderTypeModelBinderTest.cs (1)
35var serviceProvider = new ServiceCollection()
ModelBinding\Binders\HeaderModelBinderTests.cs (1)
344var serviceProvider = services.BuildServiceProvider();
ModelBinding\Validation\DefaultObjectValidatorTests.cs (1)
582var provider = new ServiceCollection().AddSingleton(service.Object).BuildServiceProvider();
Routing\ActionEndpointDataSourceBaseTest.cs (1)
147var serviceProvider = services.BuildServiceProvider();
Routing\AttributeRouteTest.cs (2)
766var services = new ServiceCollection() 808var services = new ServiceCollection()
Routing\KnownRouteValueConstraintTests.cs (1)
36var serviceProvider = services.BuildServiceProvider();
ServiceFilterAttributeTest.cs (2)
16var serviceProvider = new ServiceCollection() 33var serviceProvider = new ServiceCollection()
TypeFilterAttributeTest.cs (3)
17var serviceProvider = new ServiceCollection() 39var serviceProvider = new ServiceCollection() 64var serviceProvider = new ServiceCollection()
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (2)
DataAnnotationsModelValidatorTest.cs (1)
402var provider = new ServiceCollection().AddSingleton(service.Object).BuildServiceProvider();
MvcDataAnnotationsMvcOptionsSetup.cs (1)
25var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
HasValidatorsValidationMetadataProviderIntegrationTest.cs (2)
22var services = serviceCollection.BuildServiceProvider(); 40var services = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.Localization.Test (4)
MvcLocalizationMvcBuilderExtensionsTest.cs (2)
96var serviceProvider = builder.Services.BuildServiceProvider(); 120var serviceProvider = builder.Services.BuildServiceProvider();
MvcLocalizationMvcCoreBuilderExtensionsTest.cs (2)
96var serviceProvider = builder.Services.BuildServiceProvider(); 120var serviceProvider = builder.Services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (1)
NewtonsoftJsonOutputFormatterTest.cs (1)
59var services = new ServiceCollection()
Microsoft.AspNetCore.Mvc.Razor.Test (10)
RazorHotReloadTest.cs (5)
20var serviceProvider = GetServiceProvider(); 36var serviceProvider = GetServiceProvider(); 53var serviceProvider = GetServiceProvider(); 71private static ServiceProvider GetServiceProvider() 75var serviceProvider = new ServiceCollection()
RazorPageActivatorTest.cs (1)
249var serviceProvider = new ServiceCollection()
RazorPageTest.cs (1)
1415var serviceProvider = new ServiceCollection()
RazorViewEngineOptionsTest.cs (2)
33var serviceProvider = services.BuildServiceProvider(); 63var serviceProvider = services.BuildServiceProvider();
RazorViewTest.cs (1)
1789var serviceProvider = new ServiceCollection()
Microsoft.AspNetCore.Mvc.RazorPages.Test (8)
DependencyInjection\MvcRazorPagesMvcBuilderExtensionsTest.cs (1)
28var serviceProvider = services.BuildServiceProvider();
DependencyInjection\PageConventionCollectionExtensionsTest.cs (1)
979var serviceProvider = new ServiceCollection()
Filters\PageSaveTempDataPropertyFilterFactoryTest.cs (2)
21var serviceProvider = CreateServiceProvider(); 31private ServiceProvider CreateServiceProvider()
Infrastructure\DefaultPageFactoryProviderTest.cs (3)
250var serviceProvider = new ServiceCollection() 293var serviceProvider = new ServiceCollection() 331var serviceProvider = new ServiceCollection()
src\Mvc\Mvc.Core\test\Routing\ActionEndpointDataSourceBaseTest.cs (1)
147var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
DefaultTagHelperActivatorTest.cs (1)
56var services = new ServiceCollection()
Microsoft.AspNetCore.Mvc.Test (4)
MvcOptionsSetupTest.cs (1)
301var serviceProvider = serviceCollection.BuildServiceProvider();
MvcServiceCollectionExtensionsTest.cs (3)
263var serviceProvider = services.BuildServiceProvider(); 411var root = services.BuildServiceProvider(validateScopes: true); 647var sp = services.BuildServiceProvider();
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (7)
Filters\ControllerSaveTempDataPropertyFilterFactoryTest.cs (1)
27private ServiceProvider CreateServiceProvider()
PageRemoteAttributeTest.cs (1)
164var serviceProvider = serviceCollection.BuildServiceProvider();
RemoteAttributeBaseTest.cs (1)
475var serviceProvider = serviceCollection.BuildServiceProvider();
RemoteAttributeTest.cs (2)
367var serviceProvider = serviceCollection.BuildServiceProvider(); 389var serviceProvider = serviceCollection.BuildServiceProvider();
Rendering\DefaultTemplatesUtilities.cs (1)
269var serviceProvider = new ServiceCollection()
ViewComponents\ViewViewComponentResultTest.cs (1)
427var serviceProvider = new ServiceCollection().BuildServiceProvider();
Microsoft.AspNetCore.OpenApi.Tests (15)
Extensions\OpenApiEndpointRouteBuilderExtensionsTests.cs (1)
184var serviceProvider = new ServiceCollection()
Extensions\OpenApiRouteHandlerBuilderExtensionTests.cs (7)
21var serviceProvider = new ServiceCollection() 44var serviceProvider = new ServiceCollection() 67var serviceProvider = new ServiceCollection() 95var serviceProvider = new ServiceCollection() 124var serviceProvider = new ServiceCollection() 156var serviceProvider = new ServiceCollection() 186var serviceProvider = new ServiceCollection()
Extensions\OpenApiServiceCollectionExtensionsTests.cs (6)
35var serviceProvider = services.BuildServiceProvider(); 69var serviceProvider = services.BuildServiceProvider(); 102var serviceProvider = services.BuildServiceProvider(); 135var serviceProvider = services.BuildServiceProvider(); 157var serviceProvider = services.BuildServiceProvider(); 181var serviceProvider = services.BuildServiceProvider();
Services\OpenApiDocumentProviderTests.cs (1)
71var serviceProvider = serviceCollection.BuildServiceProvider(validateScopes: true);
Microsoft.AspNetCore.Owin.Tests (1)
OwinExtensionTests.cs (1)
124var serviceProvider = new ServiceCollection().BuildServiceProvider();
Microsoft.AspNetCore.RateLimiting.Tests (5)
RateLimitingApplicationBuilderExtensionsTests.cs (3)
30var serviceProvider = services.BuildServiceProvider(); 54var serviceProvider = services.BuildServiceProvider(); 71var serviceProvider = services.BuildServiceProvider();
RateLimitingMetricsTests.cs (2)
184var serviceProvider = services.BuildServiceProvider(); 259var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.ResponseCompression.Microbenchmarks (1)
ResponseCompressionProviderBenchmark.cs (1)
17var services = new ServiceCollection()
Microsoft.AspNetCore.Routing.Tests (23)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (1)
367var serviceProvder = services.BuildServiceProvider();
CompositeEndpointDataSourceTest.cs (5)
46var applicationServices = new ServiceCollection().BuildServiceProvider(); 289var applicationServices = new ServiceCollection().BuildServiceProvider(); 329var applicationServices = new ServiceCollection().BuildServiceProvider(); 381var applicationServices = new ServiceCollection().BuildServiceProvider(); 440var applicationServices = new ServiceCollection().BuildServiceProvider();
EndpointRoutingMiddlewareFormOptionsTest.cs (1)
96var serviceProvider = new ServiceCollection().Configure<FormOptions>(options =>
InlineRouteParameterParserTests.cs (1)
964var serviceProvider = services.BuildServiceProvider();
LinkGeneratorTestBase.cs (1)
70var serviceProvider = services.BuildServiceProvider();
LinkParserTestBase.cs (1)
62var serviceProvider = services.BuildServiceProvider();
Matching\DfaMatcherConformanceTest.cs (1)
64var services = new ServiceCollection()
Matching\DfaMatcherTest.cs (1)
55var services = serviceCollection.BuildServiceProvider();
Matching\HostMatcherPolicyIntegrationTestBase.cs (1)
369var services = new ServiceCollection()
Matching\HttpMethodMatcherPolicyIntegrationTestBase.cs (1)
348var services = new ServiceCollection()
RouteBuilderTest.cs (1)
18var applicationServices = services.BuildServiceProvider();
RouteHandlerOptionsTests.cs (3)
27var serviceProvider = services.BuildServiceProvider(); 51var serviceProvider = services.BuildServiceProvider(); 63var serviceProvider = services.BuildServiceProvider();
RouteOptionsTests.cs (2)
21var serviceProvider = services.BuildServiceProvider(); 35var serviceProvider = services.BuildServiceProvider();
RoutingServiceCollectionExtensionsTests.cs (1)
76var provider = services.BuildServiceProvider();
TemplateParserDefaultValuesTests.cs (1)
147var serviceProvider = services.BuildServiceProvider();
Tree\TreeRouteBuilderTest.cs (1)
258var serviceProvider = services.BuildServiceProvider();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
ListenOptionsTests.cs (1)
26var serviceProvider = new ServiceCollection().BuildServiceProvider();
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnectionBuilder.cs (1)
47var serviceProvider = Services.BuildServiceProvider();
Microsoft.AspNetCore.SignalR.Client.Tests (11)
HubConnectionBuilderExtensionsTests.cs (8)
25var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 38var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 52var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 68var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 83var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 94var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 106var serviceProvider = connectionBuilder.Services.BuildServiceProvider(); 119var serviceProvider = connectionBuilder.Services.BuildServiceProvider();
HubConnectionBuilderTests.cs (3)
39var serviceProvider = new HubConnectionBuilder().AddNewtonsoftJsonProtocol().Services.BuildServiceProvider(); 48var serviceProvider = new HubConnectionBuilder().AddNewtonsoftJsonProtocol(options => 76var serviceProvider = new HubConnectionBuilder().AddMessagePackProtocol().Services.BuildServiceProvider();
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
DefaultHubDispatcherBenchmark.cs (1)
28var provider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
RedisDependencyInjectionExtensionsTests.cs (1)
25var provider = services.BuildServiceProvider();
Microsoft.AspNetCore.SignalR.Tests (7)
AddSignalRTests.cs (7)
39var serviceProvider = serviceCollection.BuildServiceProvider(); 64var serviceProvider = serviceCollection.BuildServiceProvider(); 85var serviceProvider = serviceCollection.BuildServiceProvider(); 102var serviceProvider = serviceCollection.BuildServiceProvider(); 129var serviceProvider = serviceCollection.BuildServiceProvider(); 154var serviceProvider = serviceCollection.BuildServiceProvider(); 181var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.AspNetCore.TestHost.Tests (2)
TestServerTests.cs (2)
313var serviceProvider = new ServiceCollection().BuildServiceProvider(); 495var appServices = new ServiceCollection().BuildServiceProvider();
Microsoft.AspNetCore.Tests (4)
WebApplicationTests.cs (4)
1386var sp = builder.Services.BuildServiceProvider(); 1403var sp = builder.Services.BuildServiceProvider(); 1531using (var serviceProvider = builder.Services.BuildServiceProvider()) 1559var childServiceProvider = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider();
Microsoft.AspNetCore.WebSockets.Tests (1)
AddWebSocketsTests.cs (1)
24var services = serviceCollection.BuildServiceProvider();
Microsoft.DotNet.Build.Tasks.Feed.Tests (13)
BuildModelFactoryTests.cs (1)
52ServiceProvider provider = new ServiceCollection()
GenerateBuildManifestTests.cs (2)
26var provider = collection.BuildServiceProvider(); 65using var provider = collection.BuildServiceProvider();
PublishArtifactsInManifestTests.cs (2)
51using var provider = collection.BuildServiceProvider(); 268var provider = collection.BuildServiceProvider();
PushToBuildStorageTests.cs (8)
218using var provider = collection.BuildServiceProvider(); 249using var provider = collection.BuildServiceProvider(); 297using var provider = collection.BuildServiceProvider(); 346using var provider = collection.BuildServiceProvider(); 393using var provider = collection.BuildServiceProvider(); 443using var provider = collection.BuildServiceProvider(); 548using var provider = collection.BuildServiceProvider(); 563var provider = collection.BuildServiceProvider();
Microsoft.DotNet.Helix.Sdk.Tests (24)
CreateXHarnessAndroidWorkItemsTests.cs (6)
53using var provider = collection.BuildServiceProvider(); 71using var provider = collection.BuildServiceProvider(); 110using var provider = collection.BuildServiceProvider(); 140using var provider = collection.BuildServiceProvider(); 173using var provider = collection.BuildServiceProvider(); 205var provider = collection.BuildServiceProvider();
CreateXHarnessAppleWorkItemsTests.cs (7)
55using var provider = collection.BuildServiceProvider(); 74using var provider = collection.BuildServiceProvider(); 120using var provider = collection.BuildServiceProvider(); 152using var provider = collection.BuildServiceProvider(); 181using var provider = collection.BuildServiceProvider(); 225using var provider = collection.BuildServiceProvider(); 264var provider = collection.BuildServiceProvider();
FindDotNetCliPackageTests.cs (4)
62using var provider = collection.BuildServiceProvider(); 109using var provider = collection.BuildServiceProvider(); 160using var provider = collection.BuildServiceProvider(); 214using var provider = collection.BuildServiceProvider();
InstallDotNetToolTests.cs (7)
90using var provider = collection.BuildServiceProvider(); 120using var provider = collection.BuildServiceProvider(); 145using var provider = collection.BuildServiceProvider(); 190using var provider = collection.BuildServiceProvider(); 269using var provider1 = collection1.BuildServiceProvider(); 270using var provider2 = collection2.BuildServiceProvider(); 323var provider = collection.BuildServiceProvider();
Microsoft.DotNet.VersionTools.Tasks.Tests (2)
LocalUpdatePublishedVersionsTests.cs (1)
21var provider = collection.BuildServiceProvider();
UpdatePublishedVersionsTests.cs (1)
21var provider = collection.BuildServiceProvider();
Microsoft.Extensions.AI.Tests (10)
ChatCompletion\ChatClientBuilderTest.cs (1)
15var expectedServiceProvider = new ServiceCollection().BuildServiceProvider();
ChatCompletion\DependencyInjectionPatterns.cs (4)
22var services = ServiceCollection.BuildServiceProvider(); 46var services = ServiceCollection.BuildServiceProvider(); 69var services = ServiceCollection.BuildServiceProvider(); 95var services = ServiceCollection.BuildServiceProvider();
ChatCompletion\DistributedCachingChatClientTest.cs (1)
673var services = new ServiceCollection()
ChatCompletion\LoggingChatClientTests.cs (1)
34var services = c.BuildServiceProvider();
Embeddings\DistributedCachingEmbeddingGeneratorTest.cs (1)
314var services = new ServiceCollection()
Embeddings\EmbeddingGeneratorBuilderTests.cs (1)
15var expectedServiceProvider = new ServiceCollection().BuildServiceProvider();
Embeddings\LoggingEmbeddingGeneratorTests.cs (1)
33var services = c.BuildServiceProvider();
Microsoft.Extensions.AmbientMetadata.Application.Tests (2)
ApplicationMetadataExtensionsTests.cs (2)
110using var provider = new ServiceCollection() 130using var provider = new ServiceCollection()
Microsoft.Extensions.AsyncState.Tests (1)
AsyncStateTests.cs (1)
257var services = new ServiceCollection().AddAsyncState().BuildServiceProvider();
Microsoft.Extensions.Caching.Hybrid.Tests (44)
BufferReleaseTests.cs (5)
17private static ServiceProvider GetDefaultCache(out DefaultHybridCache cache, Action<ServiceCollection>? config = null) 22ServiceProvider provider = services.BuildServiceProvider(); 30using var provider = GetDefaultCache(out var cache); 112using var provider = GetDefaultCache(out var cache, 173using var provider = GetDefaultCache(out var cache,
FunctionalTests.cs (6)
11private static ServiceProvider GetDefaultCache(out DefaultHybridCache cache, Action<ServiceCollection>? config = null) 16ServiceProvider provider = services.BuildServiceProvider(); 24using var provider = GetDefaultCache(out var cache); 40using var provider = GetDefaultCache(out var cache); 52using var provider = GetDefaultCache(out var cache); 68using var provider = GetDefaultCache(out var cache);
L2Tests.cs (4)
34private ServiceProvider GetDefaultCache(bool buffers, out DefaultHybridCache cache) 41ServiceProvider provider = services.BuildServiceProvider(); 51using var provider = GetDefaultCache(buffers, out var cache); 109using var provider = GetDefaultCache(buffers, out var cache);
RedisTests.cs (1)
48ServiceProvider provider = services.BuildServiceProvider(); // not "using" - that will tear down our redis; use the fixture for that
SampleUsage.cs (4)
19using ServiceProvider provider = services.BuildServiceProvider(); 39using ServiceProvider provider = services.BuildServiceProvider(); 59using ServiceProvider provider = services.BuildServiceProvider(); 79using ServiceProvider provider = services.BuildServiceProvider();
ServiceConstructionTests.cs (10)
30using ServiceProvider provider = services.BuildServiceProvider(); 43using ServiceProvider provider = services.BuildServiceProvider(); 91using ServiceProvider provider = services.BuildServiceProvider(); 104using ServiceProvider provider = services.BuildServiceProvider(); 117using ServiceProvider provider = services.BuildServiceProvider(); 131using ServiceProvider provider = services.BuildServiceProvider(); 143using ServiceProvider provider = services.BuildServiceProvider(); 166using ServiceProvider provider = services.BuildServiceProvider(); 178using ServiceProvider provider = services.BuildServiceProvider(); 201using ServiceProvider provider = services.BuildServiceProvider();
SizeTests.cs (4)
51using ServiceProvider provider = services.BuildServiceProvider(); 120using ServiceProvider provider = services.BuildServiceProvider(); 164using ServiceProvider provider = services.BuildServiceProvider(); 230using ServiceProvider provider = services.BuildServiceProvider();
StampedeTests.cs (9)
15private static ServiceProvider GetDefaultCache(out DefaultHybridCache cache) 27ServiceProvider provider = services.BuildServiceProvider(); 70using var scope = GetDefaultCache(out var cache); 160using var scope = GetDefaultCache(out var cache); 238using var scope = GetDefaultCache(out var cache); 318using var scope = GetDefaultCache(out var cache); 358using var scope = GetDefaultCache(out var cache); 402using var scope = GetDefaultCache(out var cache); 434using var scope = GetDefaultCache(out var cache);
UnreliableL2Tests.cs (1)
142var lifetime = services.BuildServiceProvider();
Microsoft.Extensions.Caching.SqlServer.Tests (1)
SqlServerCacheServicesExtensionsTest.cs (1)
46var serviceProvider = services.BuildServiceProvider();
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (4)
CacheServiceExtensionsTests.cs (4)
43var serviceProvider = services.BuildServiceProvider(); 70using var serviceProvider = services.BuildServiceProvider(); 87using var serviceProvider = services.BuildServiceProvider(); 114var serviceProvider = services.BuildServiceProvider();
Microsoft.Extensions.Compliance.Redaction.Tests (5)
HmacRedactorExtensionsTests.cs (2)
16using var serviceProvider = new ServiceCollection() 29using var serviceProvider = new ServiceCollection()
RedactionAcceptanceTests.cs (3)
20using var services = new ServiceCollection() 43using var services = new ServiceCollection() 63using var serviceProvider = new ServiceCollection()
Microsoft.Extensions.Compliance.Testing.Tests (12)
RedactionFakesAcceptanceTests.cs (11)
20using var services = new ServiceCollection() 39using var services = new ServiceCollection() 59using var services = new ServiceCollection() 78using var services = new ServiceCollection() 98using var services = new ServiceCollection() 117using var services = new ServiceCollection() 137using var services = new ServiceCollection() 157using var services = new ServiceCollection() 177using var services = new ServiceCollection() 199using var services = new ServiceCollection() 245using var sp = new ServiceCollection().AddFakeRedaction().BuildServiceProvider();
RedactionFakesEventCollectorTests.cs (1)
25using var sp = new ServiceCollection().BuildServiceProvider();
Microsoft.Extensions.DependencyInjection (42)
DependencyInjectionEventSource.cs (13)
28private readonly List<WeakReference<ServiceProvider>> _providers = new(); 97public void ServiceResolved(ServiceProvider provider, Type serviceType) 106public void CallSiteBuilt(ServiceProvider provider, Type serviceType, ServiceCallSite callSite) 125public void DynamicMethodBuilt(ServiceProvider provider, Type serviceType, int methodSize) 143public void ServiceProviderBuilt(ServiceProvider provider) 147_providers.Add(new WeakReference<ServiceProvider>(provider)); 154public void ServiceProviderDisposed(ServiceProvider provider) 161WeakReference<ServiceProvider> reference = _providers[i]; 162if (!reference.TryGetTarget(out ServiceProvider? target) || target == provider) 171private void WriteServiceProviderBuilt(ServiceProvider provider) 288foreach (WeakReference<ServiceProvider> reference in _providers) 290if (reference.TryGetTarget(out ServiceProvider? provider)) 305public static void ExpressionTreeGenerated(this DependencyInjectionEventSource source, ServiceProvider provider, Type serviceType, Expression expression)
ServiceCollectionContainerBuilderExtensions.cs (10)
9/// Extension methods for building a <see cref="ServiceProvider"/> from an <see cref="IServiceCollection"/>. 14/// Creates a <see cref="ServiceProvider"/> containing services from the provided <see cref="IServiceCollection"/>. 17/// <returns>The <see cref="ServiceProvider"/>.</returns> 18public static ServiceProvider BuildServiceProvider(this IServiceCollection services) 24/// Creates a <see cref="ServiceProvider"/> containing services from the provided <see cref="IServiceCollection"/> 31/// <returns>The <see cref="ServiceProvider"/>.</returns> 32public static ServiceProvider BuildServiceProvider(this IServiceCollection services, bool validateScopes) 38/// Creates a <see cref="ServiceProvider"/> containing services from the provided <see cref="IServiceCollection"/> 45/// <returns>The <see cref="ServiceProvider"/>.</returns> 46public static ServiceProvider BuildServiceProvider(this IServiceCollection services, ServiceProviderOptions options)
ServiceLookup\CallSiteFactory.cs (3)
65if (ServiceProvider.VerifyOpenGenericServiceTrimmability) 275if (ServiceProvider.VerifyAotCompatibility && itemType.IsValueType) 435if (ServiceProvider.VerifyAotCompatibility)
ServiceLookup\CallSiteRuntimeResolver.cs (1)
180Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType.");
ServiceLookup\CompiledServiceProviderEngine.cs (1)
18public CompiledServiceProviderEngine(ServiceProvider provider)
ServiceLookup\DynamicServiceProviderEngine.cs (2)
13private readonly ServiceProvider _serviceProvider; 16public DynamicServiceProviderEngine(ServiceProvider serviceProvider) : base(serviceProvider)
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (3)
49public ExpressionResolverBuilder(ServiceProvider serviceProvider) 122Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType."); 131Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType.");
ServiceLookup\Expressions\ExpressionsServiceProviderEngine.cs (1)
13public ExpressionsServiceProviderEngine(ServiceProvider serviceProvider)
ServiceLookup\IEnumerableCallSite.cs (1)
18Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !itemType.IsValueType, "If VerifyAotCompatibility=true, an IEnumerableCallSite should not be created with a ValueType.");
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (1)
59public ILEmitResolverBuilder(ServiceProvider serviceProvider)
ServiceLookup\ILEmit\ILEmitServiceProviderEngine.cs (1)
14public ILEmitServiceProviderEngine(ServiceProvider serviceProvider)
ServiceLookup\ServiceProviderCallSite.cs (1)
15public override Type ImplementationType { get; } = typeof(ServiceProvider);
ServiceLookup\ServiceProviderEngineScope.cs (2)
23public ServiceProviderEngineScope(ServiceProvider provider, bool isRootScope) 41internal ServiceProvider RootProvider { get; }
ServiceProvider.cs (2)
275private readonly ServiceProvider _serviceProvider; 277public ServiceProviderDebugView(ServiceProvider serviceProvider)
Microsoft.Extensions.Diagnostics.HealthChecks.Common.Tests (5)
ApplicationLifecycleHealthChecksExtensionsTests.cs (1)
55using var serviceProvider = serviceCollection.BuildServiceProvider();
ManualHealthCheckExtensionsTests.cs (1)
50using var serviceProvider = serviceCollection.BuildServiceProvider();
TelemetryHealthChecksPublisherExtensionsTests.cs (3)
24using var serviceProvider = serviceCollection.BuildServiceProvider(); 44using var serviceProvider = serviceCollection.BuildServiceProvider(); 62using var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (10)
DefaultHealthCheckServiceTest.cs (1)
40var services = serviceCollection.BuildServiceProvider();
DependencyInjection\HealthChecksBuilderTest.cs (8)
29var serviceProvider = services.BuildServiceProvider(); 49var serviceProvider = services.BuildServiceProvider(); 72var serviceProvider = services.BuildServiceProvider(); 94var serviceProvider = services.BuildServiceProvider(); 120var serviceProvider = services.BuildServiceProvider(); 143var serviceProvider = services.BuildServiceProvider(); 166var serviceProvider = services.BuildServiceProvider(); 189var serviceProvider = services.BuildServiceProvider();
HealthCheckPublisherHostedServiceTest.cs (1)
784var services = serviceCollection.BuildServiceProvider();
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (10)
Linux\AcceptanceTest.cs (5)
30using var services = new ServiceCollection() 59using var services = new ServiceCollection() 77using var services = new ServiceCollection() 111using var services = new ServiceCollection() 160using var services = new ServiceCollection()
ResourceMonitoringBuilderTests.cs (2)
16using var provider = new ServiceCollection() 37using var provider = new ServiceCollection()
ResourceMonitoringExtensionsTests.cs (3)
34using var provider = new ServiceCollection() 54using var provider = new ServiceCollection() 70using var provider = new ServiceCollection()
Microsoft.Extensions.Diagnostics.Testing.Tests (4)
Logging\FakeLoggerExtensionsTests.cs (4)
18using var serviceProvider = new ServiceCollection() 34using var serviceProvider = new ServiceCollection() 62using var serviceProvider = new ServiceCollection() 82using var serviceProvider = new ServiceCollection()
Microsoft.Extensions.Http.Diagnostics.Tests (46)
Latency\HttpClientLatencyTelemetryExtensionsTest.cs (4)
36using var sp = new ServiceCollection() 60using var sp = new ServiceCollection() 74using var sp = new ServiceCollection() 98using var sp = new ServiceCollection()
Logging\AcceptanceTests.cs (15)
30await using var sp = new ServiceCollection() 62await using var sp = new ServiceCollection() 96await using var sp = new ServiceCollection() 133await using var provider = new ServiceCollection() 210await using var provider = new ServiceCollection() 295await using var sp = new ServiceCollection() 341await using var sp = new ServiceCollection() 406await using var sp = new ServiceCollection() 447using var provider = new ServiceCollection() 481using var provider = new ServiceCollection() 516using var provider = new ServiceCollection() 581await using var provider = new ServiceCollection() 603await using var provider = new ServiceCollection() 631await using var provider = new ServiceCollection() 659await using var provider = new ServiceCollection()
Logging\HttpClientLoggerTest.cs (1)
1011var builder = new ServiceCollection()
Logging\HttpClientLoggingExtensionsTest.cs (12)
84using var provider = services 107using var provider = services 130using var provider = services 177using var provider = services.BuildServiceProvider(); 229using var provider = new ServiceCollection() 244using var provider = new ServiceCollection() 287using var provider = services.BuildServiceProvider(); 314using var provider = new ServiceCollection() 336using var provider = new ServiceCollection() 359using var provider = new ServiceCollection() 379using var provider = new ServiceCollection() 397using var sp = new ServiceCollection()
Logging\HttpRequestReaderTest.cs (9)
75using var serviceProvider = GetServiceProvider(headersReader, serviceKey); 138using var serviceProvider = GetServiceProvider(headersReader); 201using var serviceProvider = GetServiceProvider(headersReader); 276using var serviceProvider = GetServiceProvider(headersReader, configureRedaction: x => x.RedactionFormat = Redacted); 348using var serviceProvider = GetServiceProvider(headersReader); 406using var serviceProvider = GetServiceProvider(headersReader); 477using var serviceProvider = GetServiceProvider(headersReader); 544using var serviceProvider = GetServiceProvider(headersReader); 576private static ServiceProvider GetServiceProvider(
Telemetry\DownstreamDependencyMetadataManagerTests.cs (1)
15private readonly ServiceProvider _sp;
TelemetryCommonExtensionsTests.cs (4)
40var sp = new ServiceCollection().AddFakeRedaction().AddHttpRouteProcessor().BuildServiceProvider(); 55var sp = new ServiceCollection().AddFakeRedaction().AddHttpHeadersRedactor().BuildServiceProvider(); 64var sp = serviceCollection.AddOutgoingRequestContext().BuildServiceProvider(); 88var sp = serviceCollection.AddOutgoingRequestContext().BuildServiceProvider();
Microsoft.Extensions.Http.Polly.Tests (13)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (13)
51var services = serviceCollection.BuildServiceProvider(); 86var services = serviceCollection.BuildServiceProvider(); 124var services = serviceCollection.BuildServiceProvider(); 165var services = serviceCollection.BuildServiceProvider(); 209var services = serviceCollection.BuildServiceProvider(); 262var services = serviceCollection.BuildServiceProvider(); 307var services = serviceCollection.BuildServiceProvider(); 351var services = serviceCollection.BuildServiceProvider(); 421var services = serviceCollection.BuildServiceProvider(); 451var services = serviceCollection.BuildServiceProvider(); 469var services = serviceCollection.BuildServiceProvider(); 488var services = serviceCollection.BuildServiceProvider(); 508var services = serviceCollection.BuildServiceProvider();
Microsoft.Extensions.Http.Resilience.PerformanceTests (3)
HedgingBenchmark.cs (1)
23var serviceProvider = HttpClientFactory.InitializeServiceProvider(Type);
HttpClientFactory.cs (1)
34public static ServiceProvider InitializeServiceProvider(params HedgingClientType[] clientType)
HttpResilienceBenchmark.cs (1)
36var serviceProvider = HttpClientFactory.InitializeServiceProvider(HedgingClientType.Ordered, HedgingClientType.NoRoutes);
Microsoft.Extensions.Http.Resilience.Tests (14)
Hedging\HedgingTests.cs (1)
38private ServiceProvider? _serviceProvider;
Hedging\StandardHedgingTests.cs (6)
65using var serviceProvider = Builder.Services.BuildServiceProvider(); 80using var serviceProvider = Builder.Services.BuildServiceProvider(); 102using var serviceProvider = Builder.Services.BuildServiceProvider(); 111using var serviceProvider = Builder.Services.BuildServiceProvider(); 173using var serviceProvider = Builder.Services.BuildServiceProvider(); 335await using var provider = services.BuildServiceProvider();
Resilience\HttpClientBuilderExtensionsTests.Resilience.cs (5)
77using (var serviceProvider = services.BuildServiceProvider()) 173using var serviceProvider = builder.Services.BuildServiceProvider(); 215using var provider = services.BuildServiceProvider(); 263using var provider = services.BuildServiceProvider(); 283using var serviceProvider = clientBuilder.Services.BuildServiceProvider();
Resilience\HttpClientBuilderExtensionsTests.Standard.cs (2)
27private ServiceProvider? _serviceProvider; 156using var serviceProvider = new ServiceCollection()
Microsoft.Extensions.Logging (3)
LoggerFactory.cs (3)
115ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(); 298private readonly ServiceProvider _serviceProvider; 300public DisposingLoggerFactory(ILoggerFactory loggerFactory, ServiceProvider serviceProvider)
Microsoft.Extensions.ML.Tests (7)
FileLoaderTests.cs (3)
32var sp = services.BuildServiceProvider(); 45var sp = services.BuildServiceProvider(); 64var sp = services.BuildServiceProvider();
PredictionEnginePoolTests.cs (1)
36var sp = services.BuildServiceProvider();
UriLoaderTests.cs (3)
32var sp = services.BuildServiceProvider(); 45var sp = services.BuildServiceProvider(); 64var sp = services.BuildServiceProvider();
Microsoft.Extensions.ObjectPool.DependencyInjection.Tests (13)
DependencyInjectionExtensionsTests.cs (13)
52using var provider = services.BuildServiceProvider(); 67using var provider = services.BuildServiceProvider(validateScopes: true); 90using var provider = services.BuildServiceProvider(validateScopes: true); 103using var provider = services.BuildServiceProvider(validateScopes: true); 118using var provider = services.BuildServiceProvider(); 132using var provider = services.BuildServiceProvider(validateScopes: true); 146using var provider = services.BuildServiceProvider(validateScopes: true); 162using var provider = services.BuildServiceProvider(validateScopes: true); 181using var provider = services.BuildServiceProvider(validateScopes: true); 216using var provider = services.BuildServiceProvider(validateScopes: true); 230using var provider = services.BuildServiceProvider(validateScopes: true); 265using var provider = services.BuildServiceProvider(validateScopes: true); 322using var provider = services.BuildServiceProvider(validateScopes: true);
Microsoft.Extensions.Options.Contextual.Tests (5)
ContextualOptionsServiceCollectionExtensionsTests.cs (5)
22using var provider = new ServiceCollection().AddContextualOptions().BuildServiceProvider(); 35using var provider = new ServiceCollection().Configure(loadOptions).BuildServiceProvider(); 45using var provider = new ServiceCollection().Configure(configureOptions).BuildServiceProvider(); 57using var provider = new ServiceCollection().ConfigureAll(loadOptions).BuildServiceProvider(); 67using var provider = new ServiceCollection().ConfigureAll(configureOptions).BuildServiceProvider();
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
DnsServiceEndpointResolverTests.cs (1)
17var services = new ServiceCollection()
DnsSrvServiceEndpointResolverTests.cs (2)
102var services = new ServiceCollection() 193var services = serviceCollection.BuildServiceProvider();
Microsoft.Extensions.ServiceDiscovery.Tests (19)
ConfigurationServiceEndpointResolverTests.cs (7)
27var services = new ServiceCollection() 63var services = new ServiceCollection() 144var services = new ServiceCollection() 244var services = new ServiceCollection() 286var services = new ServiceCollection() 353var services = new ServiceCollection() 398var services = new ServiceCollection()
PassThroughServiceEndpointResolverTests.cs (4)
23var services = new ServiceCollection() 54var services = new ServiceCollection() 87var services = new ServiceCollection() 121var services = new ServiceCollection()
ServiceEndpointResolverTests.cs (8)
25var services = new ServiceCollection() 36var services = new ServiceCollection() 49var services = new ServiceCollection() 61var services = serviceCollection.BuildServiceProvider(); 102var services = new ServiceCollection() 154var services = new ServiceCollection() 190var services = new ServiceCollection() 235var services = new ServiceCollection()
Microsoft.Extensions.ServiceDiscovery.Yarp.Tests (7)
YarpServiceDiscoveryTests.cs (7)
32await using var services = new ServiceCollection() 62await using var services = new ServiceCollection() 92await using var services = new ServiceCollection() 126await using var services = new ServiceCollection() 205await using var services = new ServiceCollection() 235await using var services = new ServiceCollection() 293await using var services = new ServiceCollection()
Microsoft.Extensions.Telemetry.Abstractions.Tests (5)
Enrichment\EnricherExtensionsTests.cs (2)
40using var provider = services.BuildServiceProvider(); 59using var provider = services.BuildServiceProvider();
Latency\LatencyRegistryExtensionsTests.cs (1)
42var serviceProvider = services.BuildServiceProvider();
Latency\NoopLatencyContextTests.cs (2)
22using var serviceProvider = new ServiceCollection() 34using var serviceProvider = new ServiceCollection()
Microsoft.Extensions.Telemetry.Tests (12)
Http\HttpParserTests.cs (1)
644var sp = new ServiceCollection().AddHttpRouteProcessor().AddFakeRedaction().BuildServiceProvider();
Http\TelemetryCommonExtensionsTests.cs (1)
38var sp = new ServiceCollection().AddFakeRedaction().AddHttpRouteProcessor().BuildServiceProvider();
Latency\LatencyConsoleExtensionsTests.cs (3)
28using var serviceProvider = new ServiceCollection() 41using var serviceProvider = new ServiceCollection() 59using var provider = new ServiceCollection()
Latency\LatencyContextExtensionTests.cs (4)
27using var serviceProvider = new ServiceCollection() 43using var serviceProvider = new ServiceCollection() 70using var serviceProvider = new ServiceCollection() 95using var provider = new ServiceCollection()
Logging\Utils.cs (3)
22ServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(); 31private readonly ServiceProvider _serviceProvider; 33public DisposingLoggerFactory(ILoggerFactory loggerFactory, ServiceProvider serviceProvider)
Microsoft.Extensions.WebEncoders.Tests (3)
EncoderServiceCollectionExtensionsTests.cs (3)
23var serviceProvider = serviceCollection.BuildServiceProvider(); 46var serviceProvider = serviceCollection.BuildServiceProvider(); 78var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.Gen.Logging.Generated.Tests (3)
Utils.cs (3)
41private readonly ServiceProvider _serviceProvider; 43public TestLogger(ILogger logger, ServiceProvider serviceProvider, FakeLogger fakeLogger) 90var serviceProvider = serviceCollection.BuildServiceProvider();
Microsoft.ML.AutoML (1)
AutoMLExperiment\AutoMLExperiment.cs (1)
229var serviceProvider = _serviceCollection.BuildServiceProvider();
Redis (1)
Program.cs (1)
19using (var services = new ServiceCollection()
Shared.Tests (3)
Debugger\DebuggerTest.cs (3)
23using var provider = new ServiceCollection() 36using var provider = new ServiceCollection() 49using var provider = new ServiceCollection()
Wasm.Performance.ConsoleHost (1)
Scenarios\ComponentRenderingScenarioBase.cs (1)
28var serviceProvider = serviceCollection.BuildServiceProvider();