5 implementations of IHost
Aspire.Hosting (1)
Microsoft.AspNetCore (1)
Microsoft.AspNetCore.Mvc.Testing (1)
Microsoft.Extensions.Hosting (1)
Microsoft.Extensions.Hosting.Testing (1)
1696 references to IHost
Aspire.Azure.AI.OpenAI.Tests (13)
Aspire.Azure.Data.Tables.Tests (5)
Aspire.Azure.Messaging.EventHubs.Tests (11)
Aspire.Azure.Messaging.ServiceBus.Tests (6)
Aspire.Azure.Messaging.WebPubSub.Tests (7)
Aspire.Azure.Search.Documents.Tests (3)
Aspire.Azure.Security.KeyVault.Tests (3)
Aspire.Azure.Storage.Blobs.Tests (5)
Aspire.Azure.Storage.Queues.Tests (5)
Aspire.Components.Common.Tests (15)
Aspire.Confluent.Kafka.Tests (14)
Aspire.Dashboard.Tests (7)
Aspire.Elastic.Clients.Elasticsearch.Tests (5)
Aspire.Hosting (12)
Aspire.Hosting.Azure.Tests (5)
Aspire.Hosting.Elasticsearch.Tests (3)
Aspire.Hosting.Garnet.Tests (3)
Aspire.Hosting.Kafka.Tests (3)
Aspire.Hosting.Milvus.Tests (3)
Aspire.Hosting.MongoDB.Tests (4)
Aspire.Hosting.MySql.Tests (5)
Aspire.Hosting.Nats.Tests (5)
Aspire.Hosting.Oracle.Tests (4)
Aspire.Hosting.PostgreSQL.Tests (4)
Aspire.Hosting.Qdrant.Tests (3)
Aspire.Hosting.RabbitMQ.Tests (3)
Aspire.Hosting.Redis.Tests (7)
Aspire.Hosting.SqlServer.Tests (3)
Aspire.Hosting.Testing (12)
DistributedApplicationFactory.cs (11)
393var hostDescriptor = applicationBuilder.Services.Single(s => s.ServiceType == typeof(IHost) && s.ServiceKey is null);
399{ ImplementationFactory: { } factory } => ServiceDescriptor.KeyedSingleton<IHost>(this, (sp, _) => (IHost)factory(sp)),
400{ ImplementationInstance: { } instance } => ServiceDescriptor.KeyedSingleton<IHost>(this, (IHost)instance),
401{ ImplementationType: { } type } => ServiceDescriptor.KeyedSingleton(typeof(IHost), this, type),
402_ => throw new InvalidOperationException($"Registered service descriptor for {typeof(IHost)} does not conform to any known pattern.")
407applicationBuilder.Services.AddSingleton<IHost>(sp => new ObservedHost(sp.GetRequiredKeyedService<IHost>(this), this));
410private sealed class ObservedHost(IHost innerHost, DistributedApplicationFactory appFactory) : IHost, IAsyncDisposable
Aspire.Hosting.Valkey.Tests (3)
Aspire.Keycloak.Authentication.Tests (8)
Aspire.Microsoft.Azure.Cosmos.Tests (1)
Aspire.Microsoft.Data.SqlClient.Tests (4)
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (11)
Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests (20)
Aspire.Milvus.Client.Tests (6)
Aspire.MongoDB.Driver.Tests (8)
Aspire.MySqlConnector.Tests (5)
Aspire.NATS.Net.Tests (8)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (21)
Aspire.Npgsql.Tests (6)
Aspire.OpenAI.Tests (7)
Aspire.Oracle.EntityFrameworkCore.Tests (24)
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (20)
Aspire.Qdrant.Client.Tests (3)
Aspire.RabbitMQ.Client.Tests (8)
Aspire.Seq.Tests (1)
Aspire.StackExchange.Redis.DistributedCaching.Tests (1)
Aspire.StackExchange.Redis.OutputCaching.Tests (1)
Aspire.StackExchange.Redis.Tests (9)
AutobahnTestApp (1)
AzureAppServicesHostingStartupSample (1)
AzureAppServicesSample (1)
AzureFunctionsEndToEnd.Functions (1)
Binding.UDS.IntegrationTests (15)
blazor-devserver (1)
ConfigurationSchemaGenerator.Tests (1)
CookiePolicySample (1)
CookieSessionSample (1)
CorsMiddlewareWebSite (1)
DaprServiceC (1)
DatabaseErrorPageSample (1)
DatabaseMigration.MigrationService (1)
DefaultBuilder.SampleApp (1)
DelegationSite (1)
DeveloperExceptionPageSample (1)
Diagnostics.EFCore.FunctionalTests (20)
DatabaseErrorPageMiddlewareTest.cs (14)
27using var host = new HostBuilder()
64using var host = new HostBuilder()
104using var host = await SetupServer<BloggingContext, DatabaseErrorButNoMigrationsMiddleware>(database);
137using var host = await SetupServer<BloggingContext, NoMigrationsMiddleware>(database);
172using (var server = await SetupServer<BloggingContext, NoMigrationsMiddleware>(database))
198using var host = await SetupServer<BloggingContextWithMigrations, PendingMigrationsMiddleware>(database);
237using var host = await SetupServer<BloggingContextWithPendingModelChanges, PendingModelChangesMiddleware>(database);
277using var host = await SetupServer<BloggingContextWithMigrations, ApplyMigrationsMiddleware>(database);
335using var host = new HostBuilder()
378using var host = new HostBuilder()
443using var host = await SetupServer<BloggingContextWithSnapshotThatThrows, ExceptionInLogicMiddleware>(database, logProvider);
483using var host = await SetupServer<BloggingContext, WrappedExceptionMiddleware>(database);
517private static async Task<IHost> SetupServer<TContext, TMiddleware>(SqlTestStore database, ILoggerProvider logProvider = null)
520var host = new HostBuilder()
Diagnostics.FunctionalTests (1)
EventHubsConsumer (1)
ExceptionHandlerSample (1)
GenericWebHost (1)
HealthChecksSample (1)
HostFilteringSample (1)
HotAddSample (1)
http2cat (1)
Http3SampleApp (1)
HttpOverridesSample (1)
HttpsPolicySample (1)
IIS.Tests (1)
IISSample (1)
InMemory.FunctionalTests (1)
Interop.FunctionalTests (88)
JwtBearerSample (1)
LargeResponseApp (1)
LocalizationSample (1)
LocalizationWebsite (1)
Microsoft.AspNetCore (4)
Microsoft.AspNetCore.Authentication.Negotiate.Test (40)
Microsoft.AspNetCore.Authentication.Test (267)
CookieTests.cs (61)
38using var host = await CreateHost(s => { });
47using var host = await CreateHost(o => o.LoginPath = "/login");
59using var host = await CreateHost(o => o.AccessDeniedPath = "/denied");
71using var host = await CreateHost(o => o.LogoutPath = "/signout");
83using var host = await CreateHost(s => { });
95using var host = await CreateHost(s => { });
129using var host = await CreateHostWithServices(s => s.AddAuthentication().AddCookie(o =>
189using var host = await CreateHostWithServices(s =>
224using var host = await CreateHostWithServices(s =>
256using var host = await CreateHostWithServices(s => s.AddAuthentication(schemeName).AddCookie(schemeName, o =>
299using var host = await CreateHost(o =>
312using var host = await CreateHost(o =>
334using var host = await CreateHost(o =>
358using var host = await CreateHost(o =>
384using var host2 = await CreateHost(o =>
409using var host = await CreateHost(o => { }, SignInAsAlice);
422using var host = await CreateHost(o => { },
440using var host = await CreateHost(o =>
470using var host = await CreateHost(o =>
504using var host = await CreateHost(o =>
533using var host = await CreateHost(o =>
562using var host = await CreateHost(o =>
599using var host = await CreateHost(o =>
645using var host = await CreateHost(o =>
673using var host = await CreateHost(o =>
721using var host = await CreateHost(o =>
766using var host = await CreateHost(o =>
822using var host = await CreateHost(o =>
881using var host = await CreateHost(o =>
931using var host = await CreateHost(o =>
982using var host = await CreateHost(o =>
1020using var host = await CreateHost(o =>
1057using var host = await CreateHost(o =>
1103using var host = await CreateHost(o =>
1155using var host = await CreateHost(o => { },
1172using var host = await CreateHost(o => { }, SignInAsAlice);
1186using var host = await CreateHost(o => { }, SignInAsAlice);
1200using var host = await CreateHost(o =>
1216using var host = await CreateHost(o =>
1234using var host = new HostBuilder()
1269using var host = new HostBuilder()
1293using var host = new HostBuilder()
1321using var host = new HostBuilder()
1349using var host = new HostBuilder()
1372using var host = new HostBuilder()
1398using var host = new HostBuilder()
1420using var host = new HostBuilder()
1446using var host = new HostBuilder()
1470using var host = new HostBuilder()
1500using var host = await CreateHost(o =>
1522using var host = await CreateHost(o =>
1544using var host = await CreateHost(o =>
1567using var host = await CreateHost(o =>
1589using var host = await CreateHost(o =>
1613using var host = new HostBuilder()
1638using var host1 = new HostBuilder()
1661using var host2 = new HostBuilder()
1689using var host = new HostBuilder()
1793private Task<IHost> CreateHost(Action<CookieAuthenticationOptions> configureOptions, Func<HttpContext, Task> testpath = null, Uri baseAddress = null, bool claimsTransform = false)
1807private static async Task<IHost> CreateHostWithServices(Action<IServiceCollection> configureServices, Func<HttpContext, Task> testpath = null, Uri baseAddress = null)
1809var host = new HostBuilder()
Microsoft.AspNetCore.CookiePolicy.Test (7)
Microsoft.AspNetCore.Cors.Test (10)
Microsoft.AspNetCore.DataProtection.Tests (2)
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (33)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (3)
Microsoft.AspNetCore.Diagnostics.Tests (39)
Microsoft.AspNetCore.HeaderPropagation.Tests (7)
Microsoft.AspNetCore.HostFiltering.Tests (6)
Microsoft.AspNetCore.Hosting.Tests (7)
Microsoft.AspNetCore.Http.Connections.Tests (21)
MapConnectionHandlerTests.cs (15)
39using (var host = BuildWebHost<AuthConnectionHandler>("/auth",
77using (var host = BuildWebHost<AuthConnectionHandler>("/auth",
104using (var host = BuildWebHost<InheritedAuthConnectionHandler>("/auth",
132using (var host = BuildWebHost<DoubleAuthConnectionHandler>("/auth",
159using (var host = BuildWebHost<AuthConnectionHandler>("/auth",
190using (var host = BuildWebHost<AuthConnectionHandler>("/path", options =>
219using (var host = BuildWebHost<AuthConnectionHandler>("/path", options =>
255using (var host = BuildWebHost(ConfigureRoutes))
293using (var host = BuildWebHost(ConfigureRoutes))
329using (var host = BuildWebHost(ConfigureRoutes))
363using (var host = BuildWebHost(ConfigureRoutes))
387using var host = BuildWebHost<MyConnectionHandler>("/socket",
412using var host = BuildWebHost<MyConnectionHandler>("/test", o => { });
484private IHost BuildWebHost(Action<IEndpointRouteBuilder> configure)
505private IHost BuildWebHost<TConnectionHandler>(string path, Action<HttpConnectionDispatcherOptions> configureOptions, Action<IEndpointConventionBuilder> configureEndpoints = null) where TConnectionHandler : ConnectionHandler
Microsoft.AspNetCore.HttpLogging.Tests (12)
Microsoft.AspNetCore.HttpOverrides.Tests (40)
Microsoft.AspNetCore.HttpsPolicy.Tests (18)
Microsoft.AspNetCore.Identity.FunctionalTests (2)
Microsoft.AspNetCore.Identity.InMemory.Test (1)
Microsoft.AspNetCore.Localization.FunctionalTests (2)
Microsoft.AspNetCore.Localization.Routing.Tests (3)
Microsoft.AspNetCore.Localization.Tests (19)
Microsoft.AspNetCore.MiddlewareAnalysis.Tests (1)
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
Microsoft.AspNetCore.Mvc.Testing (13)
Microsoft.AspNetCore.OpenApi.Tests (1)
Microsoft.AspNetCore.OutputCaching.Tests (41)
Microsoft.AspNetCore.RequestDecompression.Tests (6)
Microsoft.AspNetCore.ResponseCaching.Tests (37)
Microsoft.AspNetCore.ResponseCompression.Tests (17)
Microsoft.AspNetCore.Rewrite.Tests (65)
Microsoft.AspNetCore.Routing.FunctionalTests (35)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (22)
AuthenticationTests.cs (17)
30using (var server = Utilities.CreateDynamicHost(authType, AllowAnoymous, out var address, httpContext =>
51using (var server = Utilities.CreateDynamicHost(authType, DenyAnoymous, out var address, httpContext =>
69using (var server = Utilities.CreateDynamicHost(authType, AllowAnoymous, out var address, httpContext =>
119using (var server = Utilities.CreateDynamicHost(authType, AllowAnoymous, out var address, httpContext =>
153using (var server = Utilities.CreateDynamicHost(authType, DenyAnoymous, out var address, httpContext =>
173using (var server = Utilities.CreateDynamicHost(authTypes, DenyAnoymous, out var address, httpContext =>
203using (var server = Utilities.CreateDynamicHost(authType, AllowAnoymous, out var address, async httpContext =>
227using (var server = Utilities.CreateDynamicHost(authType, DenyAnoymous, out var address, async httpContext =>
250using (var server = Utilities.CreateDynamicHost(authType, AllowAnoymous, out var address, httpContext =>
273using (var server = Utilities.CreateDynamicHost(authType, AllowAnoymous, out var address, async httpContext =>
291using (var server = Utilities.CreateDynamicHost(authTypes, AllowAnoymous, out var address, httpContext =>
317using (var server = Utilities.CreateDynamicHost(authType, AllowAnoymous, out var address, httpContext =>
335using (var server = Utilities.CreateDynamicHost(authTypes, AllowAnoymous, out var address, httpContext =>
356using (var server = Utilities.CreateDynamicHost(authType, DenyAnoymous, out var address, httpContext =>
379using (var server = Utilities.CreateDynamicHost(out var address, options =>
409using (var server = Utilities.CreateDynamicHost(out var address, options =>
436using (var server = Utilities.CreateDynamicHost(out var address, options =>
Utilities.cs (4)
71internal static IHost CreateDynamicHost(AuthenticationSchemes authType, bool allowAnonymous, out string root, RequestDelegate app, ILoggerFactory loggerFactory)
80internal static IHost CreateDynamicHost(out string baseAddress, Action<HttpSysOptions> configureOptions, RequestDelegate app, ILoggerFactory loggerFactory)
85internal static IHost CreateDynamicHost(string basePath, out string root, out string baseAddress, Action<HttpSysOptions> configureOptions, RequestDelegate app, ILoggerFactory loggerFactory)
102var host = builder.Build();
Microsoft.AspNetCore.Server.IISIntegration.Tests (13)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (11)
Microsoft.AspNetCore.Session.Tests (21)
Microsoft.AspNetCore.SignalR.Tests (12)
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (9)
Microsoft.AspNetCore.StaticFiles.Tests (76)
Microsoft.AspNetCore.TestHost (3)
Microsoft.AspNetCore.TestHost.Tests (27)
Microsoft.AspNetCore.Testing (4)
Microsoft.AspNetCore.Testing.Tests (10)
Microsoft.AspNetCore.WebSockets.Tests (5)
Microsoft.Extensions.AmbientMetadata.Application.Tests (1)
Microsoft.Extensions.Diagnostics.Probes.Tests (15)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (6)
Microsoft.Extensions.Hosting (28)
Microsoft.Extensions.Hosting.Abstractions (30)
Microsoft.Extensions.Hosting.Systemd (5)
Microsoft.Extensions.Hosting.Testing (13)
Microsoft.Extensions.Hosting.Testing.Tests (19)
Microsoft.Extensions.Hosting.WindowsServices (6)
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Microsoft.Extensions.Options.Contextual.Tests (1)
Microsoft.Extensions.Telemetry.Tests (6)
MiddlewareAnalysisSample (1)
NativeIISSample (1)
Negotiate.Server (2)
OpenIdConnectSample (1)
OrderProcessor (1)
PlaintextApp (1)
QueueSharing (1)
RequestDecompressionSample (1)
ResponseCachingSample (1)
ResponseCompressionSample (1)
RewriteSample (1)
RoutingSandbox (1)
RoutingWebSite (1)
SampleStartups (6)
SessionSample (1)
SignalRSamples (1)
SocialWeather (1)
Sockets.BindTests (26)
Sockets.FunctionalTests (20)
src\Servers\Kestrel\test\FunctionalTests\MaxRequestBufferSizeTests.cs (4)
135using (var host = await StartHost(maxRequestBufferSize, data, connectionAdapter, startReadingRequestBody, clientFinishedSendingRequestBody, memoryPoolFactory.Create))
228using (var host = await StartHost(16 * 1024, data, false, startReadingRequestBody, clientFinishedSendingRequestBody, memoryPoolFactory.Create))
304private async Task<IHost> StartHost(long? maxRequestBufferSize,
311var host = TransportSelector.GetHostBuilder(memoryPoolFactory, maxRequestBufferSize)
StaticFileSample (1)
StatusCodePagesSample (1)
Stress.TelemetryService (1)
TestProject.WorkerA (1)
Wasm.Performance.Driver (4)
WelcomePageSample (1)
WsFedSample (1)