5 implementations of IHost
Aspire.Hosting (1)
DistributedApplication.cs (1)
49public class DistributedApplication : IHost, IAsyncDisposable
Microsoft.AspNetCore (1)
WebApplication.cs (1)
25public sealed class WebApplication : IHost, IApplicationBuilder, IEndpointRouteBuilder, IAsyncDisposable
Microsoft.AspNetCore.Mvc.Testing (1)
DeferredHostBuilder.cs (1)
118private sealed class DeferredHost : IHost, IAsyncDisposable
Microsoft.Extensions.Hosting (1)
Internal\Host.cs (1)
21internal sealed class Host : IHost, IAsyncDisposable
Microsoft.Extensions.Hosting.Testing (1)
FakeHost.cs (1)
14public sealed class FakeHost : IHost
1696 references to IHost
Aspire.Azure.AI.OpenAI.Tests (13)
AspireAzureAIOpenAIExtensionsTests.cs (6)
43using var host = builder.Build(); 74using var host = builder.Build(); 100using var host = builder.Build(); 122using var host = builder.Build(); 142using var host = builder.Build(); 189using var host = builder.Build();
AspireConfigurableOpenAIExtensionsTests.cs (7)
57using var host = builder.Build(); 84using var host = builder.Build(); 111using var host = builder.Build(); 132using var host = builder.Build(); 157using var host = builder.Build(); 184using var host = builder.Build(); 211using var host = builder.Build();
Aspire.Azure.Data.Tables.Tests (5)
AspireTablesExtensionsTests.cs (5)
35using var host = builder.Build(); 62using var host = builder.Build(); 92using var host = builder.Build(); 120using var host = builder.Build(); 142using var host = builder.Build();
Aspire.Azure.Messaging.EventHubs.Tests (11)
AspireEventHubsExtensionsTests.cs (11)
105using var host = builder.Build(); 163using var host = builder.Build(); 225using var host = builder.Build(); 291using var host = builder.Build(); 349using var host = builder.Build(); 397using var host = builder.Build(); 451using var host = builder.Build(); 455private static void RetrieveAndAssert(bool useKeyed, int clientIndex, IHost host) 462private static object RetrieveClient(object? key, int clientIndex, IHost host) 532using var host = builder.Build(); 565using var host = builder.Build();
Aspire.Azure.Messaging.ServiceBus.Tests (6)
AspireServiceBusExtensionsTests.cs (6)
35using var host = builder.Build(); 62using var host = builder.Build(); 92using var host = builder.Build(); 120using var host = builder.Build(); 142using var host = builder.Build(); 171using var host = builder.Build();
Aspire.Azure.Messaging.WebPubSub.Tests (7)
AspireWebPubSubExtensionsTests.cs (7)
36var host = builder.Build(); 71var host = builder.Build(); 102var host = builder.Build(); 131var host = builder.Build(); 149var host = builder.Build(); 175var host = builder.Build(); 194var host = builder.Build();
Aspire.Azure.Search.Documents.Tests (3)
AspireAzureSearchExtensionsTests.cs (3)
36using var host = builder.Build(); 63using var host = builder.Build(); 86using var host = builder.Build();
Aspire.Azure.Security.KeyVault.Tests (3)
AspireKeyVaultExtensionsTests.cs (3)
38using var host = builder.Build(); 68using var host = builder.Build(); 189using var host = builder.Build();
Aspire.Azure.Storage.Blobs.Tests (5)
AspireBlobStorageExtensionsTests.cs (5)
35using var host = builder.Build(); 62using var host = builder.Build(); 92using var host = builder.Build(); 120using var host = builder.Build(); 142using var host = builder.Build();
Aspire.Azure.Storage.Queues.Tests (5)
AspireQueueStorageExtensionsTests.cs (5)
35using var host = builder.Build(); 62using var host = builder.Build(); 92using var host = builder.Build(); 120using var host = builder.Build(); 142using var host = builder.Build();
Aspire.Components.Common.Tests (15)
ConformanceTests.cs (15)
106using IHost host = CreateHostWithComponent(options => SetHealthCheck(options, enabled)); 121using IHost host = CreateHostWithMultipleKeyedComponents(key1, key2); 144using IHost host = CreateHostWithComponent(options => SetTracing(options, enabled)); 158using IHost host = CreateHostWithComponent(options => SetMetrics(options, enabled)); 176using IHost host = CreateHostWithComponent(key: key); 224using IHost host = CreateHostWithMultipleKeyedComponents(key1, key2); 245using IHost host = builder.Build(); 277using IHost host = builder.Build(); 309using IHost host = CreateHostWithComponent(configureComponent: DisableRetries, key: key); 365using var host = builder.Build(); 389using var host = builder.Build(); 411using var host = builder.Build(); 432using (IHost host = builder.Build()) 457protected IHost CreateHostWithComponent(Action<TOptions>? configureComponent = null, HostApplicationBuilderSettings? hostSettings = null, string? key = null) 466protected IHost CreateHostWithMultipleKeyedComponents(params string[] keys)
Aspire.Confluent.Kafka.Tests (14)
ConsumerConfigurationTests.cs (5)
37using var host = builder.Build(); 70using var host = builder.Build(); 103using var host = builder.Build(); 182using var host = builder.Build(); 252using var host = builder.Build();
ConsumerConformanceTests.cs (1)
107using var host = builder.Build();
MetricsTests.cs (2)
40using (var host = builder.Build()) 157using (var host = builder.Build())
ProducerConfigurationTests.cs (5)
34using var host = builder.Build(); 64using var host = builder.Build(); 96using var host = builder.Build(); 172using var host = builder.Build(); 241using var host = builder.Build();
ProducerConformanceTests.cs (1)
98using var host = builder.Build();
Aspire.Dashboard.Tests (7)
Middleware\ValidateTokenMiddlewareTests.cs (7)
21using var host = await SetUpHostAsync(FrontendAuthMode.Unsecured, string.Empty).DefaultTimeout(); 29using var host = await SetUpHostAsync(FrontendAuthMode.Unsecured, string.Empty).DefaultTimeout(); 37using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token").DefaultTimeout(); 45using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token").DefaultTimeout(); 53using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token").DefaultTimeout(); 61using var host = await SetUpHostAsync(FrontendAuthMode.BrowserToken, "token").DefaultTimeout(); 66private static async Task<IHost> SetUpHostAsync(FrontendAuthMode authMode, string expectedToken)
Aspire.Elastic.Clients.Elasticsearch.Tests (5)
AspireElasticClientExtensionsTest.cs (5)
55using var host = builder.Build(); 88using var host = builder.Build(); 109using var host = builder.Build(); 133using var host = builder.Build(); 154using var host = builder.Build();
Aspire.Hosting (12)
DistributedApplication.cs (12)
14/// Represents a distributed application that implements the <see cref="IHost"/> and <see cref="IAsyncDisposable"/> interfaces. 18/// The <see cref="DistributedApplication"/> is an implementation of the <see cref="IHost"/> interface that orchestrates 51private readonly IHost _host; 56/// <param name="host">The <see cref="IHost"/> instance.</param> 57public DistributedApplication(IHost host) 195/// The <see cref="DistributedApplication"/> is an <see cref="IHost"/> implementation and as such 208/// Disposes the distributed application by disposing the <see cref="IHost"/>. 239/// Asynchronously disposes the distributed application by disposing the <see cref="IHost"/>. 270/// <inheritdoc cref="IHost.StartAsync" /> 277/// <inheritdoc cref="IHost.StopAsync" /> 367Task IHost.StartAsync(CancellationToken cancellationToken) => StartAsync(cancellationToken); 369Task IHost.StopAsync(CancellationToken cancellationToken) => StopAsync(cancellationToken);
Aspire.Hosting.Azure.Tests (5)
AzureCosmosDBEmulatorFunctionalTests.cs (3)
97using var host = hb.Build(); 173using (var host = hb.Build()) 219using (var host = hb.Build())
AzureEventHubsExtensionsTests.cs (1)
82using var host = hb.Build();
AzureStorageEmulatorFunctionalTests.cs (1)
81using var host = hb.Build();
Aspire.Hosting.Elasticsearch.Tests (3)
ElasticsearchFunctionalTests.cs (3)
51using var host = hb.Build(); 114using (var host = hb.Build()) 159using (var host = hb.Build())
Aspire.Hosting.Garnet.Tests (3)
GarnetFunctionalTests.cs (3)
82using var host = hb.Build(); 161using (var host = hb.Build()) 212using (var host = hb.Build())
Aspire.Hosting.Kafka.Tests (3)
KafkaFunctionalTests.cs (3)
85using var host = hb.Build(); 173using (var host = hb.Build()) 229using (var host = hb.Build())
Aspire.Hosting.Milvus.Tests (3)
MilvusFunctionalTests.cs (3)
40using var host = hb.Build(); 114using (var host = hb.Build()) 162using (var host = hb.Build())
Aspire.Hosting.MongoDB.Tests (4)
MongoDbFunctionalTests.cs (4)
93using var host = hb.Build(); 153using (var host = hb.Build()) 200using (var host = hb.Build()) 321using var host = hb.Build();
Aspire.Hosting.MySql.Tests (5)
MySqlFunctionalTests.cs (5)
98using var host = hb.Build(); 171using (var host = hb.Build()) 241using (var host = hb.Build()) 347using var host = hb.Build(); 417using var host = hb.Build();
Aspire.Hosting.Nats.Tests (5)
NatsFunctionalTests.cs (5)
51using var host = hb.Build(); 95using var host = hb.Build(); 143using var host = hb.Build(); 202using (var host = hb.Build()) 249using (var host = hb.Build())
Aspire.Hosting.Oracle.Tests (4)
OracleFunctionalTests.cs (4)
56using var host = hb.Build(); 139using (var host = hb.Build()) 200using (var host = hb.Build()) 314using var host = hb.Build();
Aspire.Hosting.PostgreSQL.Tests (4)
PostgresFunctionalTests.cs (4)
128using var host = hb.Build(); 244using (var host = hb.Build()) 305using (var host = hb.Build()) 397using var host = hb.Build();
Aspire.Hosting.Qdrant.Tests (3)
QdrantFunctionalTests.cs (3)
51using var host = hb.Build(); 135using (var host = hb.Build()) 180using (var host = hb.Build())
Aspire.Hosting.RabbitMQ.Tests (3)
RabbitMQFunctionalTests.cs (3)
77using var host = hb.Build(); 138using (var host = hb.Build()) 195using (var host = hb.Build())
Aspire.Hosting.Redis.Tests (7)
RedisFunctionalTests.cs (7)
110using var host = hb.Build(); 321using (var host = hb.Build()) 357using (var host = hb.Build()) 407using (var host = hb.Build()) 442using (var host = hb.Build()) 491using (var host = hb.Build()) 521using (var host = hb.Build())
Aspire.Hosting.SqlServer.Tests (3)
SqlServerFunctionalTests.cs (3)
86using var host = hb.Build(); 190using var host1 = hb1.Build(); 272using (var host2 = hb2.Build())
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
DistributedApplicationTestingBuilder.cs (1)
211private sealed class DelegatedHost(SuspendingDistributedApplicationFactory appFactory, DistributedApplication innerApp) : IHost, IAsyncDisposable
Aspire.Hosting.Valkey.Tests (3)
ValkeyFunctionalTests.cs (3)
41using var host = hb.Build(); 102using (var host = hb.Build()) 153using (var host = hb.Build())
Aspire.Keycloak.Authentication.Tests (8)
AspireKeycloakExtensionTests.cs (8)
27using var host = builder.Build(); 47using var host = builder.Build(); 68using var host = builder.Build(); 90using var host = builder.Build(); 108using var host = builder.Build(); 128using var host = builder.Build(); 150using var host = builder.Build(); 173using var host = builder.Build();
Aspire.Microsoft.Azure.Cosmos.Tests (1)
ConformanceTests.cs (1)
90using var host = builder.Build();
Aspire.Microsoft.Data.SqlClient.Tests (4)
AspireSqlServerSqlClientExtensionsTests.cs (4)
35using var host = builder.Build(); 63using var host = builder.Build(); 95using var host = builder.Build(); 119using var host = builder.Build();
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (11)
AspireAzureEfCoreCosmosDBExtensionsTests.cs (4)
35using var host = builder.Build(); 72using var host = builder.Build(); 112using var host = builder.Build(); 143using var host = builder.Build();
ConformanceTests.cs (2)
82using IHost host = CreateHostWithComponent(); 92using IHost host = CreateHostWithComponent();
EnrichCosmosDbTests.cs (5)
67using var host = builder.Build(); 96using var host = builder.Build(); 117using var host = builder.Build(); 133using var host = builder.Build(); 155using var host = builder.Build();
Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests (20)
AspireSqlServerEFCoreSqlClientExtensionsTests.cs (8)
30using var host = builder.Build(); 46using var host = builder.Build(); 66using var host = builder.Build(); 93using var host = builder.Build(); 137using var host = builder.Build(); 178using var host = builder.Build(); 213using var host = builder.Build(); 244using var host = builder.Build();
ConformanceTests.cs (2)
100using IHost host = CreateHostWithComponent(); 110using IHost host = CreateHostWithComponent();
EnrichSqlServerTests.cs (10)
73using var host = builder.Build(); 107using var host = builder.Build(); 128using var host = builder.Build(); 171using var host = builder.Build(); 209using var host = builder.Build(); 237using var host = builder.Build(); 258using var host = builder.Build(); 275using var host = builder.Build(); 302using var host = builder.Build(); 320using var host = builder.Build();
Aspire.Milvus.Client.Tests (6)
AspireMilvusExtensionTests.cs (5)
48using var host = builder.Build(); 72using var host = builder.Build(); 102using var host = builder.Build(); 133using var host = builder.Build(); 166using var host = builder.Build();
ConformanceTests.cs (1)
118using var host = builder.Build();
Aspire.MongoDB.Driver.Tests (8)
AspireMongoDBDriverExtensionsTests.cs (7)
38using var host = builder.Build(); 84using var host = builder.Build(); 130using var host = builder.Build(); 152using var host = builder.Build(); 174using var host = builder.Build(); 196using var host = builder.Build(); 217using var host = builder.Build();
ConformanceTests.cs (1)
112using IHost host = CreateHostWithComponent(key: key);
Aspire.MySqlConnector.Tests (5)
AspireMySqlConnectorExtensionsTests.cs (4)
43using var host = builder.Build(); 71using var host = builder.Build(); 103using var host = builder.Build(); 127using var host = builder.Build();
ConformanceTests.cs (1)
107using IHost host = CreateHostWithComponent(key: key);
Aspire.NATS.Net.Tests (8)
AspireNatsClientExtensionsTests.cs (8)
50using var host = builder.Build(); 77using var host = builder.Build(); 108using var host = builder.Build(); 140using var host = builder.Build(); 167using var host = builder.Build(); 200using var host = builder.Build(); 220using var host = builder.Build(); 249using var host = builder.Build();
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (21)
AspireEFPostgreSqlExtensionsTests.cs (8)
38using var host = builder.Build(); 56using var host = builder.Build(); 76using var host = builder.Build(); 103using var host = builder.Build(); 145using var host = builder.Build(); 186using var host = builder.Build(); 220using var host = builder.Build(); 251using var host = builder.Build();
ConformanceTests.cs (2)
117using IHost host = CreateHostWithComponent(); 127using IHost host = CreateHostWithComponent();
EnrichNpgsqlTests.cs (11)
75using var host = builder.Build(); 110using var host = builder.Build(); 132using var host = builder.Build(); 176using var host = builder.Build(); 215using var host = builder.Build(); 245using var host = builder.Build(); 267using var host = builder.Build(); 285using var host = builder.Build(); 313using var host = builder.Build(); 332using var host = builder.Build(); 365using var host = builder.Build();
Aspire.Npgsql.Tests (6)
AspirePostgreSqlNpgsqlExtensionsTests.cs (5)
35using var host = builder.Build(); 63using var host = builder.Build(); 95using var host = builder.Build(); 127using var host = builder.Build(); 149using var host = builder.Build();
ConformanceTests.cs (1)
109using IHost host = CreateHostWithComponent(key: key);
Aspire.OpenAI.Tests (7)
AspireOpenAIExtensionsTests.cs (7)
36using var host = builder.Build(); 63using var host = builder.Build(); 83using var host = builder.Build(); 101using var host = builder.Build(); 125using var host = builder.Build(); 172using var host = builder.Build(); 192using var host = builder.Build();
Aspire.Oracle.EntityFrameworkCore.Tests (24)
AspireOracleEFCoreDatabaseExtensionsTests.cs (10)
31using var host = builder.Build(); 47using var host = builder.Build(); 67using var host = builder.Build(); 94using var host = builder.Build(); 138using var host = builder.Build(); 179using var host = builder.Build(); 214using var host = builder.Build(); 245using var host = builder.Build(); 313using var host = builder.Build(); 329using var host = builder.Build();
ConformanceTests.cs (3)
111using IHost host = CreateHostWithComponent(); 123using IHost host = CreateHostWithComponent(); 158using (IHost host = builder.Build())
EnrichOracleDatabaseTests.cs (11)
74using var host = builder.Build(); 108using var host = builder.Build(); 129using var host = builder.Build(); 172using var host = builder.Build(); 210using var host = builder.Build(); 238using var host = builder.Build(); 259using var host = builder.Build(); 276using var host = builder.Build(); 303using var host = builder.Build(); 321using var host = builder.Build(); 353using var host = builder.Build();
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (20)
AspireEFMySqlExtensionsTests.cs (7)
43using var host = builder.Build(); 62using var host = builder.Build(); 84using var host = builder.Build(); 112using var host = builder.Build(); 155using var host = builder.Build(); 198using var host = builder.Build(); 236using var host = builder.Build();
ConformanceTests.cs (2)
114using IHost host = CreateHostWithComponent(); 123using IHost host = CreateHostWithComponent();
EnrichMySqlTests.cs (11)
87using var host = builder.Build(); 121using var host = builder.Build(); 142using var host = builder.Build(); 185using var host = builder.Build(); 223using var host = builder.Build(); 251using var host = builder.Build(); 272using var host = builder.Build(); 289using var host = builder.Build(); 316using var host = builder.Build(); 334using var host = builder.Build(); 366using var host = builder.Build();
Aspire.Qdrant.Client.Tests (3)
AspireQdrantClientExtensionsTest.cs (3)
47using var host = builder.Build(); 80using var host = builder.Build(); 101using var host = builder.Build();
Aspire.RabbitMQ.Client.Tests (8)
AspireRabbitMQExtensionsTests.cs (5)
45using var host = builder.Build(); 74using var host = builder.Build(); 105using var host = builder.Build(); 148using var host = builder.Build(); 180using var host = builder.Build();
AspireRabbitMQLoggingTests.cs (3)
56using var host = builder.Build(); 80using var host = builder.Build(); 109using var host = builder.Build();
Aspire.Seq.Tests (1)
SeqEndpointCanBeConfigured.cs (1)
24using var host = builder.Build();
Aspire.StackExchange.Redis.DistributedCaching.Tests (1)
AspireRedisDistributedCacheExtensionsTests.cs (1)
21using var host = builder.Build();
Aspire.StackExchange.Redis.OutputCaching.Tests (1)
AspireRedisOutputCacheExtensionsTests.cs (1)
20using var host = builder.Build();
Aspire.StackExchange.Redis.Tests (9)
AspireRedisExtensionsTests.cs (9)
48using var host = builder.Build(); 74using var host = builder.Build(); 103using var host = builder.Build(); 136using var host = builder.Build(); 192using var host = builder.Build(); 222using var host = builder.Build(); 251using var host = builder.Build(); 317using var host = builder.Build(); 354using var host = builder.Build();
AutobahnTestApp (1)
Program.cs (1)
76var host = builder.Build();
AzureAppServicesHostingStartupSample (1)
Startup.cs (1)
59var host = new HostBuilder()
AzureAppServicesSample (1)
Startup.cs (1)
70var host = new HostBuilder()
AzureFunctionsEndToEnd.Functions (1)
Program.cs (1)
16var host = builder.Build();
Binding.UDS.IntegrationTests (15)
.packages\corewcf.primitives\1.6.0\contentFiles\CoreWCFWebApplicationExtensions.cs (1)
14public static Microsoft.Extensions.Hosting.IHost UseServiceModel(this Microsoft.AspNetCore.Builder.WebApplication app, Action<IServiceBuilder> configureServices)
ServiceHelper.cs (5)
17public static IHost CreateWebHostBuilder<TStartup>(string linuxSocketFilepath = "", [CallerMemberName] string callerMethodName = "") where TStartup : class 21var configureMethod = startupType.GetMethod("Configure", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, new Type[] { typeof(IHost) }); 34IHost host = hostBuilder.Build(); 37var configureAction = (Action<IHost>)configureMethod.CreateDelegate(typeof(Action<IHost>), startupInstance);
UDSBindingTests.cs (9)
30IHost host = ServiceHelper.CreateWebHostBuilder<StartUpForUDS>(UDS.GetUDSFilePath()); 67IHost host = ServiceHelper.CreateWebHostBuilder<StartupForWindowsAuth>(UDS.GetUDSFilePath()); 102IHost host = ServiceHelper.CreateWebHostBuilder<StartupForUnixDomainSocketTransportCertificate>(UDS.GetUDSFilePath()); 148IHost host = ServiceHelper.CreateWebHostBuilder<StartupForUnixDomainSocketTransportIdentity>(UDS.GetUDSFilePath()); 180IHost host = ServiceHelper.CreateWebHostBuilder<StartUpForUDS>(UDS.GetUDSFilePath()); 226public void Configure(IHost host) 244public void Configure(IHost host) 273public void Configure(IHost host) 312public void Configure(IHost host)
blazor-devserver (1)
Server\Program.cs (1)
23public static IHost BuildWebHost(string[] args) =>
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
688MetadataReference.CreateFromFile(typeof(IHost).Assembly.Location),
CookiePolicySample (1)
Program.cs (1)
10var host = new HostBuilder()
CookieSessionSample (1)
Program.cs (1)
10var host = new HostBuilder()
CorsMiddlewareWebSite (1)
Startup.cs (1)
20var host = new HostBuilder()
DaprServiceC (1)
Program.cs (1)
16var app = builder.Build();
DatabaseErrorPageSample (1)
Startup.cs (1)
31var host = new HostBuilder()
DatabaseMigration.MigrationService (1)
Program.cs (1)
17var app = builder.Build();
DefaultBuilder.SampleApp (1)
Program.cs (1)
87var host = new HostBuilder()
DelegationSite (1)
Program.cs (1)
26using var host = builder.Build();
DeveloperExceptionPageSample (1)
Startup.cs (1)
50var host = new HostBuilder()
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()
MigrationsEndPointMiddlewareTest.cs (6)
26using var host = new HostBuilder() 83using var host = new HostBuilder() 144using var host = new HostBuilder() 172using var host = new HostBuilder() 204using var host = new HostBuilder() 237using var host = new HostBuilder()
Diagnostics.FunctionalTests (1)
TestFixture.cs (1)
15private readonly IHost _host;
EventHubsConsumer (1)
Program.cs (1)
36var host = builder.Build();
ExceptionHandlerSample (1)
Program.cs (1)
10var host = new HostBuilder()
GenericWebHost (1)
Program.cs (1)
15var host = Host.CreateDefaultBuilder()
HealthChecksSample (1)
Program.cs (1)
29public static IHost BuildWebHost(string[] args)
HostFilteringSample (1)
Program.cs (1)
13public static IHost BuildWebHost(string[] args)
HotAddSample (1)
Startup.cs (1)
106var host = new HostBuilder()
http2cat (1)
Program.cs (1)
18using var host = new HostBuilder()
Http3SampleApp (1)
Program.cs (1)
117var host = hostBuilder.Build();
HttpOverridesSample (1)
Startup.cs (1)
35var host = new HostBuilder()
HttpsPolicySample (1)
Startup.cs (1)
45var host = new HostBuilder()
IIS.Tests (1)
Utilities\TestServer.cs (1)
56private IHost _host;
IISSample (1)
Startup.cs (1)
95var host = new HostBuilder()
InMemory.FunctionalTests (1)
TestTransport\TestServer.cs (1)
36private readonly IHost _host;
Interop.FunctionalTests (88)
H2SpecTests.cs (1)
49using (var host = hostBuilder.Build())
Http2\Http2RequestTests.cs (6)
38using (var host = builder.Build()) 116using (var host = builder.Build()) 177using (var host = builder.Build()) 204using (var host = builder.Build()) 261using var host = builder.Build(); 290private static async Task<(byte[], HttpResponseHeaders)> StartLongRunningRequestAsync(ILogger logger, IHost host, HttpMessageInvoker client)
Http2WebSocketInteropTests.cs (2)
75using var host = await hostBuilder.StartAsync().DefaultTimeout(); 134using var host = await hostBuilder.StartAsync().DefaultTimeout();
Http3\Http3RequestTests.cs (32)
79using (var host = builder.Build()) 143using (var host = builder.Build()) 245using (var host = builder.Build()) 286using (var host = builder.Build()) 335using (var host = builder.Build()) 369static async Task<HttpResponseMessage> SendRequestAsync(HttpProtocols protocol, IHost host, HttpMessageInvoker client) 410using (var host = builder.Build()) 480using (var host = builder.Build()) 552using (var host = builder.Build()) 610using (var host = builder.Build()) 670using (var host = builder.Build()) 717using (var host = builder.Build()) 773using (var host = builder.Build()) 845using (var host = builder.Build()) 905using (var host = builder.Build()) 1005using (var host = builder.Build()) 1102using (var host = builder.Build()) 1250using (var host = builder.Build()) 1311using (var host = builder.Build()) 1363using (var host = builder.Build()) 1416using (var host = builder.Build()) 1482using (var host = builder.Build()) 1535using (var host = builder.Build()) 1595using (var host = builder.Build()) 1655using (var host = builder.Build()) 1709using (var host = builder.Build()) 1772using (var host = builder.Build()) 1877using (var host = builder.Build()) 1954using (var host = builder.Build()) 2031using (var host = builder.Build()) 2131using (var host = builder.Build()) 2189using var host = await hostBuilder.StartAsync().DefaultTimeout();
Http3\Http3TlsTests.cs (8)
51using var host = builder.Build(); 98using var host = builder.Build(); 140using var host = builder.Build(); 189using var host = builder.Build(); 239using var host = builder.Build(); 279using var host = builder.Build(); 317using var host = builder.Build(); 467using var host = hostBuilder.Build();
HttpClientHttp2InteropTests.cs (35)
60using var host = await hostBuilder.StartAsync().DefaultTimeout(); 84using var host = await hostBuilder.StartAsync().DefaultTimeout(); 123using var host = await hostBuilder.StartAsync().DefaultTimeout(); 170using var host = await hostBuilder.StartAsync().DefaultTimeout(); 290using var host = await hostBuilder.StartAsync().DefaultTimeout(); 367using var host = await hostBuilder.StartAsync().DefaultTimeout(); 426using var host = await hostBuilder.StartAsync().DefaultTimeout(); 531using var host = await hostBuilder.StartAsync().DefaultTimeout(); 563using var host = await hostBuilder.StartAsync().DefaultTimeout(); 595using var host = await hostBuilder.StartAsync().DefaultTimeout(); 621using var host = await hostBuilder.StartAsync().DefaultTimeout(); 649using var host = await hostBuilder.StartAsync().DefaultTimeout(); 678using var host = await hostBuilder.StartAsync().DefaultTimeout(); 725using var host = await hostBuilder.StartAsync().DefaultTimeout(); 784using var host = await hostBuilder.StartAsync().DefaultTimeout(); 834using var host = await hostBuilder.StartAsync().DefaultTimeout(); 881using var host = await hostBuilder.StartAsync().DefaultTimeout(); 925using var host = await hostBuilder.StartAsync().DefaultTimeout(); 966using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1007using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1050using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1103using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1159using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1220using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1281using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1322using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1355using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1396using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1427using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1476using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1511using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1562using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1585using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1625using var host = await hostBuilder.StartAsync().DefaultTimeout(); 1670using var host = await hostBuilder.StartAsync().DefaultTimeout();
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (4)
17public static int GetPort(this IHost host) 22public static IEnumerable<int> GetPorts(this IHost host) 28public static IEnumerable<Uri> GetUris(this IHost host) 34public static string MakeUrl(this IHost host, string scheme)
JwtBearerSample (1)
Program.cs (1)
10var host = Host.CreateDefaultBuilder(args)
LargeResponseApp (1)
Startup.cs (1)
43var host = new HostBuilder()
LocalizationSample (1)
Startup.cs (1)
136var host = new HostBuilder()
LocalizationWebsite (1)
Program.cs (1)
14var host = new HostBuilder()
Microsoft.AspNetCore (4)
BootstrapHostBuilder.cs (1)
61public IHost Build()
ConfigureHostBuilder.cs (1)
38IHost IHostBuilder.Build()
WebApplication.cs (2)
29private readonly IHost _host; 32internal WebApplication(IHost host)
Microsoft.AspNetCore.Authentication.Negotiate.Test (40)
EventTests.cs (16)
24using var host = await CreateHostAsync(options => 49using var host = await CreateHostAsync(options => 73using var host = await CreateHostAsync(options => 97using var host = await CreateHostAsync(options => 121using var host = await CreateHostAsync(options => 146using var host = await CreateHostAsync(options => 172using var host = await CreateHostAsync(options => 196using var host = await CreateHostAsync(options => 222using var host = await CreateHostAsync(options => 246using var host = await CreateHostAsync(options => 272using var host = await CreateHostAsync(options => 302using var host = await CreateHostAsync(options => 324using var host = await CreateHostAsync(options => 348using var host = await CreateHostAsync(options => 372using var host = await CreateHostAsync(options => 409private static async Task<IHost> CreateHostAsync(Action<NegotiateOptions> configureOptions = null)
NegotiateHandlerTests.cs (21)
26using var host = await CreateHostAsync(); 36using var host = await CreateHostAsync(); 46using var host = await CreateHostAsync(); 56using var host = await CreateHostAsync(); 67using var host = await CreateHostAsync(); 79using var host = await CreateHostAsync(); 89using var host = await CreateHostAsync(); 101using var host = await CreateHostAsync(); 113using var host = await CreateHostAsync(options => options.PersistNtlmCredentials = persistNtlm); 124using var host = await CreateHostAsync(options => options.PersistKerberosCredentials = persistKerberos); 135using var host = await CreateHostAsync(options => options.PersistKerberosCredentials = persistKerberos); 147using var host = await CreateHostAsync(options => options.PersistNtlmCredentials = options.PersistKerberosCredentials = true); 174using var host = await CreateHostAsync(options => options.PersistNtlmCredentials = options.PersistKerberosCredentials = false); 200using var host = await CreateHostAsync(options => options.PersistNtlmCredentials = persist); 234using var host = await CreateHostAsync(options => options.PersistNtlmCredentials = persist); 246using var host = await CreateHostAsync(options => options.PersistNtlmCredentials = persist); 283using var host = await builder.StartAsync(); 296using var host = await CreateHostAsync(); 307using var host = await CreateHostAsync(); 318using var host = await CreateHostAsync(); 380private static async Task<IHost> CreateHostAsync(Action<NegotiateOptions> configureOptions = null)
ServerDeferralTests.cs (3)
19using var host = await CreateHostAsync(supportsAuth: false); 36using var host = await CreateHostAsync(supportsAuth: true, isEnabled: true, authScheme: "DeferralScheme"); 42private static async Task<IHost> CreateHostAsync(bool supportsAuth = false, bool isEnabled = false, string authScheme = null)
Microsoft.AspNetCore.Authentication.Test (267)
AuthenticationMiddlewareTests.cs (1)
24using var host = new HostBuilder()
CertificateTests.cs (30)
48using var host = await CreateHost( 64using var host = await CreateHost( 80using var host = await CreateHost( 95using var host = await CreateHost( 111using var host = await CreateHost( 127using var host = await CreateHost( 144using var host = await CreateHost( 162using var host = await CreateHost( 179using var host = await CreateHost( 197using var host = await CreateHost( 214using var host = await CreateHost( 231using var host = await CreateHost( 247using var host = await CreateHost( 264using var host = await CreateHost( 278using var host = await CreateHost( 293using var host = await CreateHost( 316using var host = await CreateHost( 333using var host = await CreateHost( 350using var host = await CreateHost( 368using var host = await CreateHost( 385using var host = await CreateHost( 403using var host = await CreateHost( 420using var host = await CreateHost( 439using var host = await CreateHost( 457using var host = await CreateHost( 568using var host = await CreateHost( 642using var host = await CreateHost( 695using var host = await CreateHost( 787private static async Task<IHost> CreateHost( 797var host = new HostBuilder()
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()
DynamicSchemeTests.cs (4)
24using var host = await CreateHost(s => 61using var host = await CreateHost(); 129private static async Task<IHost> CreateHost(Action<IServiceCollection> configureServices = null) 131var host = new HostBuilder()
FacebookTests.cs (10)
48using var host = await CreateHost( 64using var host = await CreateHost( 80using var host = await CreateHost( 212using var host = await CreateHost(app => app.Map("/base", map => 244using var host = await CreateHost( 277using var host = await CreateHost( 317using var host = await CreateHost( 377using var host = await CreateHost( 455private static async Task<IHost> CreateHost(Action<IApplicationBuilder> configure, Action<IServiceCollection> configureServices, Func<HttpContext, Task<bool>> handler) 457var host = new HostBuilder()
GoogleTests.cs (32)
48using var host = await CreateHost(o => 79using var host = await CreateHost(o => 92using var host = await CreateHost(o => 105using var host = await CreateHost(o => 118using var host = await CreateHost(o => 131using var host = await CreateHost(o => 144using var host = await CreateHost(o => 160using var host = await CreateHost(o => 212using var host = await CreateHost(o => 264using var host = await CreateHost(o => 319using var host = await CreateHost(o => 342using var host = await CreateHost(o => 365using var host = await CreateHost(o => 380using var host = await CreateHost(o => 414using var host = await CreateHost(o => 446using var host = await CreateHost(o => 491using var host = await CreateHost(o => 535using var host = await CreateHost(o => 591using var host = await CreateHost(o => 645using var host = await CreateHost(o => 695using var host = await CreateHost(o => 737using var host = await CreateHost(o => 772using var host = await CreateHost(o => 816using var host = await CreateHost(o => 832using var host = await CreateHost(o => 861using var host = await CreateHost(o => 905using var host = await CreateHost(o => 949using var host = await CreateHost(o => 986using var host = await CreateHost(o => 1022using var host = await CreateHost(o => 1144private static async Task<IHost> CreateHost(Action<GoogleOptions> configureOptions, Func<HttpContext, Task> testpath = null) 1146var host = new HostBuilder()
JwtBearerTests.cs (34)
67using var host = await CreateHost(o => 104using var host = await CreateHost(o => 160using var host = await CreateHost(); 169using var host = await CreateHost(); 178using var host = await CreateHost(o => 222using var host = await CreateHost(o => 253using var host = await CreateHost(o => o.UseSecurityTokenValidators = true); 262using var host = await CreateHost(o => o.UseSecurityTokenValidators = true); 271using var host = await CreateHost(o => o.UseSecurityTokenValidators = true); 281using var host = await CreateHost(options => 308using var host = await CreateHost(options => 332using var host = await CreateHost(options => 352using var host = await CreateHost(options => 371using var host = await CreateHost(options => 398using var host = await CreateHost(options => 457using var host = await CreateHost(o => 473using var host = await CreateHost(o => o.UseSecurityTokenValidators = true); 485using var host = await CreateHost(options => 524using var host = await CreateHost(options => 553using var host = await CreateHost(options => 587using var host = await CreateHost(options => 625using var host = await CreateHost(options => 659using var host = await CreateHost(options => 697using var host = await CreateHost(options => 731using var host = await CreateHost(options => 769using var host = await CreateHost(o => 794using var host = await CreateHost(o => 814using var host = await CreateHost(o => 841using var host = await CreateHost(o => 885using var host = new HostBuilder() 937using var host = await CreateHost(o => 981using var host = await CreateHost(o => 1159private static async Task<IHost> CreateHost(Action<JwtBearerOptions> options = null, Func<HttpContext, Func<Task>, Task> handlerBeforeAuth = null) 1161var host = new HostBuilder()
JwtBearerTests_Handler.cs (34)
59using var host = await CreateHost(o => 95using var host = await CreateHost(o => 150using var host = await CreateHost(); 159using var host = await CreateHost(); 168using var host = await CreateHost(o => 209using var host = await CreateHost(o => 239using var host = await CreateHost(); 248using var host = await CreateHost(); 257using var host = await CreateHost(); 267using var host = await CreateHost(options => 291using var host = await CreateHost(options => 312using var host = await CreateHost(options => 329using var host = await CreateHost(options => 345using var host = await CreateHost(options => 369using var host = await CreateHost(options => 427using var host = await CreateHost(o => 442using var host = await CreateHost(); 454using var host = await CreateHost(options => 490using var host = await CreateHost(options => 516using var host = await CreateHost(options => 549using var host = await CreateHost(options => 586using var host = await CreateHost(options => 617using var host = await CreateHost(options => 652using var host = await CreateHost(options => 683using var host = await CreateHost(options => 718using var host = await CreateHost(o => 742using var host = await CreateHost(o => 761using var host = await CreateHost(o => 787using var host = await CreateHost(o => 830using var host = new HostBuilder() 882using var host = await CreateHost(o => 925using var host = await CreateHost(o => 1218private static async Task<IHost> CreateHost(Action<JwtBearerOptions> options = null, Func<HttpContext, Func<Task>, Task> handlerBeforeAuth = null) 1220var host = new HostBuilder()
MicrosoftAccountTests.cs (13)
49using var host = await CreateHost(o => 73using var host = await CreateHost(o => 86using var host = await CreateHost(o => 99using var host = await CreateHost(o => 112using var host = await CreateHost(o => 134using var host = await CreateHost(o => 152using var host = await CreateHost(o => 170using var host = await CreateHost(o => 189using var host = await CreateHost(o => 259using var host = await CreateHost(o => 289using var host = await CreateHost(o => 355private static async Task<IHost> CreateHost(Action<MicrosoftAccountOptions> configureOptions) 357var host = new HostBuilder()
OAuthTests.cs (13)
37using var host = await CreateHost( 53using var host = await CreateHost( 69using var host = await CreateHost( 85using var host = await CreateHost( 101using var host = await CreateHost( 293using var host = await CreateHost( 320using var host = await CreateHost( 355using var host = await CreateHost( 391using var host = await CreateHost( 429using var host = await CreateHost( 473using var host = await CreateHost( 511private static async Task<IHost> CreateHost(Action<IServiceCollection> configureServices, Func<HttpContext, Task<bool>> handler = null) 513var host = new HostBuilder()
OpenIdConnect\OpenIdConnectConfigurationTests.cs (2)
433using var host = new HostBuilder() 556var host = new HostBuilder()
OpenIdConnect\OpenIdConnectEventTests.cs (1)
1266var host = new HostBuilder()
OpenIdConnect\OpenIdConnectEventTests_Handler.cs (1)
1266var host = new HostBuilder()
OpenIdConnect\TestServerBuilder.cs (1)
64var host = new HostBuilder()
PolicyTests.cs (1)
463var host = new HostBuilder()
RemoteAuthenticationTests.cs (6)
18private Task<IHost> CreateHost(Action<TOptions> configureOptions, Func<HttpContext, Task> testpath = null, bool isDefault = true) 34protected virtual async Task<IHost> CreateHostWithServices(Action<IServiceCollection> configureServices, Func<HttpContext, Task> testpath = null) 36var host = new HostBuilder() 61using var host = await CreateHost( 77using var host = await CreateHost( 89using var host = await CreateHostWithServices(
TwitterTests.cs (17)
47using var host = await CreateHost(o => 83using var host = await CreateHost(o => 99using var host = await CreateHost(o => 111using var host = await CreateHost(o => 126using var host = await CreateHost(o => 139using var host = await CreateHost(o => 152using var host = await CreateHost(o => 165using var host = await CreateHost(o => 189using var host = await CreateHost(o => 230using var host = await CreateHost(o => 279using var host = await CreateHost(o => 309using var host = await CreateHost(o => 334using var host = await CreateHost(o => 387using var host = await CreateHost((options) => 456using var host = await CreateHost((options) => 535private static async Task<IHost> CreateHost(Action<TwitterOptions> options, Func<HttpContext, Task<bool>> handler = null) 537var host = new HostBuilder()
WsFederation\WsFederationTest.cs (3)
43using var host = new HostBuilder() 203using var host = new HostBuilder() 276var host = new HostBuilder()
WsFederation\WsFederationTest_Handler.cs (3)
41using var host = new HostBuilder() 201using var host = new HostBuilder() 274var host = new HostBuilder()
Microsoft.AspNetCore.CookiePolicy.Test (7)
CookieConsentTests.cs (1)
704var host = new HostBuilder()
CookiePolicyTests.cs (6)
245using var host = new HostBuilder() 284using var host = new HostBuilder() 321using var host = new HostBuilder() 360using var host = new HostBuilder() 411using var host = new HostBuilder() 527using var host = new HostBuilder()
Microsoft.AspNetCore.Cors.Test (10)
CorsMiddlewareTests.cs (10)
27using var host = new HostBuilder() 67using var host = new HostBuilder() 116using var host = new HostBuilder() 165using var host = new HostBuilder() 230using var host = new HostBuilder() 295using var host = new HostBuilder() 338using var host = new HostBuilder() 438using var host = new HostBuilder() 511using var host = new HostBuilder() 571using var host = new HostBuilder()
Microsoft.AspNetCore.DataProtection.Tests (2)
HostingTests.cs (2)
64using (var host = builder.Build()) 92using (var host = builder.Build())
Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests (33)
HealthCheckEndpointRouteBuilderExtensionsTest.cs (3)
19using var host = new HostBuilder() 51using var host = new HostBuilder() 89using var host = new HostBuilder()
HealthCheckMiddlewareSampleTest.cs (4)
16using var host = new HostBuilder() 38using var host = new HostBuilder() 61using var host = new HostBuilder() 83using var host = new HostBuilder()
HealthCheckMiddlewareTests.cs (26)
22using var host = new HostBuilder() 45using var host = new HostBuilder() 72using var host = new HostBuilder() 99using var host = new HostBuilder() 129using var host = new HostBuilder() 159using var host = new HostBuilder() 192using var host = new HostBuilder() 225using var host = new HostBuilder() 258using var host = new HostBuilder() 296using var host = new HostBuilder() 338using var host = new HostBuilder() 373using var host = new HostBuilder() 408using var host = new HostBuilder() 440using var host = new HostBuilder() 475using var host = new HostBuilder() 512using var host = new HostBuilder() 542using var host = new HostBuilder() 570using var host = new HostBuilder() 600using var host = new HostBuilder() 629using var host = new HostBuilder() 666using var host = new HostBuilder() 702using var host = new HostBuilder() 740using var host = new HostBuilder() 778using var host = new HostBuilder() 814using var host = new HostBuilder() 858using var host = new HostBuilder()
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (3)
Latency\AcceptanceTests.cs (1)
28using var host = await FakeHost.CreateBuilder()
Latency\ChecpointAcceptanceTests.cs (1)
122using var host = await FakeHost.CreateBuilder()
Logging\AcceptanceTests.cs (1)
108using var host = await FakeHost.CreateBuilder(options => options.FakeLogging = false)
Microsoft.AspNetCore.Diagnostics.Tests (39)
DeveloperExceptionPageMiddlewareTest.cs (13)
30using var host = new HostBuilder() 78using var host = new HostBuilder() 137using var host = new HostBuilder() 197using var host = new HostBuilder() 233using var host = new HostBuilder() 270using var host = new HostBuilder() 306using var host = new HostBuilder() 343using var host = new HostBuilder() 376using var host = new HostBuilder() 410using var host = new HostBuilder() 448using var host = new HostBuilder() 541using var host = new HostBuilder() 581using var host = new HostBuilder()
ExceptionHandlerMiddlewareTest.cs (3)
36using var host = new HostBuilder() 308using var host = new HostBuilder() 371using var host = new HostBuilder()
ExceptionHandlerTest.cs (17)
30using var host = new HostBuilder() 70using var host = new HostBuilder() 126using var host = new HostBuilder() 203using var host = new HostBuilder() 259using var host = new HostBuilder() 315using var host = new HostBuilder() 383using var host = new HostBuilder() 460using var host = new HostBuilder() 513using var host = new HostBuilder() 539using var host = new HostBuilder() 611using var host = new HostBuilder() 662using var host = new HostBuilder() 697using var host = new HostBuilder() 738using var host = new HostBuilder() 997using var host = new HostBuilder() 1051using var host = new HostBuilder() 1121using var host = new HostBuilder()
StatusCodeMiddlewareTest.cs (6)
22using var host = new HostBuilder() 76using var host = new HostBuilder() 137using var host = new HostBuilder() 200using var host = new HostBuilder() 320using var host = new HostBuilder() 358using var host = new HostBuilder()
Microsoft.AspNetCore.HeaderPropagation.Tests (7)
HeaderPropagationIntegrationTest.cs (7)
24using var host = new HostBuilder() 103using var host = await CreateHost(c => 126using var host = await CreateHost(c => 153using var host = new HostBuilder() 175using var host = await CreateHost( 194private async Task<IHost> CreateHost(Action<HeaderPropagationOptions> configure, HttpMessageHandler primaryHandler, Action<HeaderPropagationMessageHandlerOptions> configureClient = null) 196var host = new HostBuilder()
Microsoft.AspNetCore.HostFiltering.Tests (6)
HostFilteringMiddlewareTests.cs (6)
21using var host = new HostBuilder() 42using var host = new HostBuilder() 83using var host = new HostBuilder() 139using var host = new HostBuilder() 191using var host = new HostBuilder() 231using var host = new HostBuilder()
Microsoft.AspNetCore.Hosting.Tests (7)
Fakes\GenericWebHost.cs (2)
13private readonly IHost _host; 15public GenericWebHost(IHost host)
GenericWebHostBuilderTests.cs (5)
22using var host = new HostBuilder() 35using var host = new HostBuilder() 48using var host = new HostBuilder() 72using var host = new HostBuilder() 108using var host = new HostBuilder()
Microsoft.AspNetCore.Http.Connections.Tests (21)
HttpConnectionDispatcherTests.cs (6)
3197using var host = CreateHost(services => 3294using var host = CreateHost(services => 3359using var host = CreateHost(services => 3453using var host = CreateHost(services => 3495using var host = new HostBuilder() 3640private static IHost CreateHost(Action<IServiceCollection> configureServices, Action<IEndpointRouteBuilder> configureEndpoints,
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)
HttpLoggingMiddlewareTests.cs (12)
1726var app = CreateApp(); 1741var app = CreateApp(defaultFields: HttpLoggingFields.None); 1756var app = CreateApp(); 1771var app = CreateApp(); 1788var app = CreateApp(HttpLoggingFields.None, new FakeInterceptor(requestContext => 1816var app = CreateApp(); 1831var app = CreateApp(defaultFields: HttpLoggingFields.None); 1846var app = CreateApp(); 1861var app = CreateApp(); 1878var app = CreateApp(HttpLoggingFields.None, new FakeInterceptor(requestContext => 1933using var host = builder.Build(); 2005private IHost CreateApp(HttpLoggingFields defaultFields = HttpLoggingFields.All, IHttpLoggingInterceptor interceptor = null)
Microsoft.AspNetCore.HttpOverrides.Tests (40)
CertificateForwardingTest.cs (5)
40using var host = new HostBuilder() 78using var host = new HostBuilder() 117using var host = new HostBuilder() 155using var host = new HostBuilder() 193using var host = new HostBuilder()
ForwardedHeadersMiddlewareTest.cs (29)
20using var host = new HostBuilder() 55using var host = new HostBuilder() 109using var host = new HostBuilder() 152using var host = new HostBuilder() 218using var host = new HostBuilder() 257using var host = new HostBuilder() 286using var host = new HostBuilder() 352using var host = new HostBuilder() 437using var host = new HostBuilder() 487using var host = new HostBuilder() 538using var host = new HostBuilder() 573using var host = new HostBuilder() 615using var host = new HostBuilder() 664using var host = new HostBuilder() 721using var host = new HostBuilder() 763using var host = new HostBuilder() 805using var host = new HostBuilder() 849using var host = new HostBuilder() 898using var host = new HostBuilder() 933using var host = new HostBuilder() 968using var host = new HostBuilder() 1025using var host = new HostBuilder() 1053using var host = new HostBuilder() 1093using var host = new HostBuilder() 1137using var host = new HostBuilder() 1179using var host = new HostBuilder() 1215using var host = new HostBuilder() 1254using var host = new HostBuilder() 1304using var host = new HostBuilder()
HttpMethodOverrideMiddlewareTest.cs (6)
18using var host = new HostBuilder() 49using var host = new HostBuilder() 79using var host = new HostBuilder() 109using var host = new HostBuilder() 147using var host = new HostBuilder() 184using var host = new HostBuilder()
Microsoft.AspNetCore.HttpsPolicy.Tests (18)
HstsMiddlewareTests.cs (8)
42using var host = new HostBuilder() 83using var host = new HostBuilder() 129using var host = new HostBuilder() 179using var host = new HostBuilder() 229using var host = new HostBuilder() 284using var host = new HostBuilder() 336using var host = new HostBuilder() 383using var host = new HostBuilder()
HttpsPolicyTests.cs (1)
28using var host = new HostBuilder()
HttpsRedirectionMiddlewareTests.cs (9)
27using var host = new HostBuilder() 77using var host = new HostBuilder() 133using var host = new HostBuilder() 189using var host = new HostBuilder() 238using var host = new HostBuilder() 285using var host = new HostBuilder() 324using var host = new HostBuilder() 377using var host = new HostBuilder() 419using var host = new HostBuilder()
Microsoft.AspNetCore.Identity.FunctionalTests (2)
Infrastructure\ServerFactory.cs (2)
59protected override IHost CreateHost(IHostBuilder builder) 61var result = base.CreateHost(builder);
Microsoft.AspNetCore.Identity.InMemory.Test (1)
FunctionalTest.cs (1)
293var host = new HostBuilder()
Microsoft.AspNetCore.Localization.FunctionalTests (2)
LocalizationSampleTest.cs (1)
19using var host = new HostBuilder()
LocalizationTest.cs (1)
98using var host = new HostBuilder()
Microsoft.AspNetCore.Localization.Routing.Tests (3)
RouteDataRequestCultureProviderTest.cs (3)
31using var host = new HostBuilder() 95using var host = new HostBuilder() 150using var host = new HostBuilder()
Microsoft.AspNetCore.Localization.Tests (19)
AcceptLanguageHeaderRequestCultureProviderTest.cs (4)
18using var host = new HostBuilder() 59using var host = new HostBuilder() 99using var host = new HostBuilder() 140using var host = new HostBuilder()
CookieRequestCultureProviderTest.cs (5)
22using var host = new HostBuilder() 75using var host = new HostBuilder() 124using var host = new HostBuilder() 175using var host = new HostBuilder() 235using var host = new HostBuilder()
CustomRequestCultureProviderTest.cs (1)
19using var host = new HostBuilder()
QueryStringRequestCultureProviderTest.cs (8)
18using var host = new HostBuilder() 60using var host = new HostBuilder() 94using var host = new HostBuilder() 135using var host = new HostBuilder() 176using var host = new HostBuilder() 218using var host = new HostBuilder() 260using var host = new HostBuilder() 307using var host = new HostBuilder()
RequestLocalizationMiddlewareTest.cs (1)
30using var host = new HostBuilder()
Microsoft.AspNetCore.MiddlewareAnalysis.Tests (1)
MiddlewareAnalysisTests.cs (1)
20using var host = new HostBuilder()
Microsoft.AspNetCore.Mvc.FunctionalTests (2)
Infrastructure\MvcTestFixture.cs (1)
62protected override IHost CreateHost(IHostBuilder builder)
TestingInfrastructureInheritanceTests.cs (1)
150protected override IHost CreateHost(IHostBuilder builder)
Microsoft.AspNetCore.Mvc.Testing (13)
DeferredHostBuilder.cs (5)
37public IHost Build() 50var host = (IHost)_hostFactory!(args.ToArray()); 120private readonly IHost _host; 123public DeferredHost(IHost host, TaskCompletionSource hostStartedTcs)
WebApplicationFactory.cs (8)
30private IHost? _host; 432/// Creates the <see cref="IHost"/> with the bootstrapped application in <paramref name="builder"/>. 437/// <returns>The <see cref="IHost"/> with the bootstrapped application.</returns> 438protected virtual IHost CreateHost(IHostBuilder builder) 440var host = builder.Build(); 610private readonly Func<IHostBuilder, IHost> _createHost; 619Func<IHostBuilder, IHost> createHost, 638protected override IHost CreateHost(IHostBuilder builder) => _createHost(builder);
Microsoft.AspNetCore.OpenApi.Tests (1)
Integration\SampleAppFixture.cs (1)
9protected override IHost CreateHost(IHostBuilder builder)
Microsoft.AspNetCore.OutputCaching.Tests (41)
OutputCacheTests.cs (41)
23using var host = builder.Build(); 45using var host = builder.Build(); 65using var host = builder.Build(); 85using var host = builder.Build(); 105using var host = builder.Build(); 127using var host = builder.Build(); 158using var host = builder.Build(); 189using var host = builder.Build(); 212using var host = builder.Build(); 239using var host = builder.Build(); 262using var host = builder.Build(); 290using var host = builder.Build(); 311using var host = builder.Build(); 335using var host = builder.Build(); 360using var host = builder.Build(); 383using var host = builder.Build(); 406using var host = builder.Build(); 429using var host = builder.Build(); 452using var host = builder.Build(); 474using var host = builder.Build(); 497using var host = builder.Build(); 519using var host = builder.Build(); 541using var host = builder.Build(); 561using var host = builder.Build(); 585using var host = builder.Build(); 610using var host = builder.Build(); 630using var host = builder.Build(); 654using var host = builder.Build(); 678using var host = builder.Build(); 704using var host = builder.Build(); 727using var host = builder.Build(); 753using var host = builder.Build(); 776using var host = builder.Build(); 803using var host = builder.Build(); 826using var host = builder.Build(); 849using var host = builder.Build(); 869using var host = builder.Build(); 893using var host = builder.Build(); 926using var host = builder.Build(); 946using var host = builder.Build(); 975using var host = builder.Build();
Microsoft.AspNetCore.RequestDecompression.Tests (6)
RequestDecompressionMiddlewareTests.cs (6)
205using var host = new HostBuilder() 275using var host = new HostBuilder() 351using var host = new HostBuilder() 446using var host = new HostBuilder() 532using var host = new HostBuilder() 690using var host = new HostBuilder()
Microsoft.AspNetCore.ResponseCaching.Tests (37)
ResponseCachingTests.cs (37)
22using var host = builder.Build(); 46using var host = builder.Build(); 68using var host = builder.Build(); 90using var host = builder.Build(); 112using var host = builder.Build(); 136using var host = builder.Build(); 169using var host = builder.Build(); 202using var host = builder.Build(); 226using var host = builder.Build(); 250using var host = builder.Build(); 273using var host = builder.Build(); 296using var host = builder.Build(); 320using var host = builder.Build(); 342using var host = builder.Build(); 364using var host = builder.Build(); 386using var host = builder.Build(); 408using var host = builder.Build(); 430using var host = builder.Build(); 452using var host = builder.Build(); 474using var host = builder.Build(); 496using var host = builder.Build(); 522using var host = builder.Build(); 549using var host = builder.Build(); 571using var host = builder.Build(); 597using var host = builder.Build(); 623using var host = builder.Build(); 650using var host = builder.Build(); 675using var host = builder.Build(); 703using var host = builder.Build(); 728using var host = builder.Build(); 754using var host = builder.Build(); 779using var host = builder.Build(); 804using var host = builder.Build(); 826using var host = builder.Build(); 852using var host = builder.Build(); 887using var host = builder.Build(); 922using var host = builder.Build();
Microsoft.AspNetCore.ResponseCompression.Tests (17)
ResponseCompressionMiddlewareTest.cs (17)
150using var host = new HostBuilder() 309using var host = new HostBuilder() 442using var host = new HostBuilder() 503using var host = new HostBuilder() 566using var host = new HostBuilder() 624using var host = new HostBuilder() 670using var host = new HostBuilder() 715using var host = new HostBuilder() 774using var host = new HostBuilder() 834using var host = new HostBuilder() 904using var host = new HostBuilder() 968using var host = new HostBuilder() 1027using var host = new HostBuilder() 1077using var host = new HostBuilder() 1127using var host = new HostBuilder() 1178using var host = new HostBuilder() 1243using var host = new HostBuilder()
Microsoft.AspNetCore.Rewrite.Tests (65)
ApacheModRewrite\ModRewriteMiddlewareTest.cs (17)
19using var host = new HostBuilder() 45using var host = new HostBuilder() 71using var host = new HostBuilder() 96using var host = new HostBuilder() 121using var host = new HostBuilder() 146using var host = new HostBuilder() 171using var host = new HostBuilder() 198using var host = new HostBuilder() 229using var host = new HostBuilder() 255using var host = new HostBuilder() 281using var host = new HostBuilder() 307using var host = new HostBuilder() 334using var host = new HostBuilder() 362using var host = new HostBuilder() 390using var host = new HostBuilder() 414using var host = new HostBuilder() 444using var host = new HostBuilder()
IISUrlRewrite\MiddleWareTests.cs (20)
29using var host = new HostBuilder() 61using var host = new HostBuilder() 97using var host = new HostBuilder() 129using var host = new HostBuilder() 165using var host = new HostBuilder() 200using var host = new HostBuilder() 234using var host = new HostBuilder() 268using var host = new HostBuilder() 305using var host = new HostBuilder() 342using var host = new HostBuilder() 379using var host = new HostBuilder() 413using var host = new HostBuilder() 455using var host = new HostBuilder() 491using var host = new HostBuilder() 527using var host = new HostBuilder() 564using var host = new HostBuilder() 600using var host = new HostBuilder() 645using var host = new HostBuilder() 677using var host = new HostBuilder() 732using var host = new HostBuilder()
MiddlewareTests.cs (28)
20using var host = new HostBuilder() 50using var host = new HostBuilder() 82using var host = new HostBuilder() 114using var host = new HostBuilder() 153using var host = new HostBuilder() 180using var host = new HostBuilder() 211using var host = new HostBuilder() 239using var host = new HostBuilder() 266using var host = new HostBuilder() 308using var host = new HostBuilder() 340using var host = new HostBuilder() 366using var host = new HostBuilder() 393using var host = new HostBuilder() 422using var host = new HostBuilder() 451using var host = new HostBuilder() 476using var host = new HostBuilder() 511using var host = new HostBuilder() 539using var host = new HostBuilder() 568using var host = new HostBuilder() 593using var host = new HostBuilder() 618using var host = new HostBuilder() 643using var host = new HostBuilder() 678using var host = new HostBuilder() 705using var host = new HostBuilder() 738using var host = new HostBuilder() 766using var host = new HostBuilder() 791using var host = new HostBuilder() 820using var host = new HostBuilder()
Microsoft.AspNetCore.Routing.FunctionalTests (35)
Benchmarks\EndpointRoutingBenchmarkTest.cs (1)
16private readonly IHost _host;
Benchmarks\RouterBenchmarkTest.cs (1)
17private readonly IHost _host;
EndpointRoutingIntegrationTest.cs (10)
33using var host = new HostBuilder() 65using var host = new HostBuilder() 97using var host = new HostBuilder() 129using var host = new HostBuilder() 160using var host = new HostBuilder() 190using var host = new HostBuilder() 221using var host = new HostBuilder() 252using var host = new HostBuilder() 284using var host = new HostBuilder() 320using var host = new HostBuilder()
EndpointRoutingSampleTest.cs (1)
15private readonly IHost _host;
MinimalFormTests.cs (15)
26using var host = new HostBuilder() 76using var host = new HostBuilder() 136using var host = new HostBuilder() 176using var host = new HostBuilder() 221using var host = new HostBuilder() 252using var host = new HostBuilder() 297using var host = new HostBuilder() 394using var host = new HostBuilder() 437using var host = new HostBuilder() 505using var host = new HostBuilder() 554using var host = new HostBuilder() 606using var host = new HostBuilder() 658using var host = new HostBuilder() 704using var host = new HostBuilder() 731using var host = new HostBuilder()
RouteHandlerTest.cs (2)
24using var host = new HostBuilder() 68using var host = new HostBuilder()
RouterSampleTest.cs (1)
15private readonly IHost _host;
RoutingTestFixture.cs (1)
17var host = new HostBuilder()
ShortCircuitTests.cs (2)
18using var host = new HostBuilder() 61using var host = new HostBuilder()
WebHostBuilderExtensionsTest.cs (1)
79using var host = new HostBuilder()
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 =>
DelegateTests.cs (1)
29using var host = builder.Build();
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)
IISExtensionTests.cs (1)
21using var host = new HostBuilder()
IISMiddlewareTests.cs (12)
29using var host = new HostBuilder() 66using var host = new HostBuilder() 107using var host = new HostBuilder() 166using var host = new HostBuilder() 211using var host = new HostBuilder() 256using var host = new HostBuilder() 296using var host = new HostBuilder() 329using var host = new HostBuilder() 358using var host = new HostBuilder() 396using var host = new HostBuilder() 438using var host = new HostBuilder() 495using var host = new HostBuilder()
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
InMemoryTransportBenchmark.cs (1)
37private IHost _host;
NamedPipesTransportBenchmark.cs (1)
33private IHost _host;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (11)
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (4)
17public static int GetPort(this IHost host) 22public static IEnumerable<int> GetPorts(this IHost host) 28public static IEnumerable<Uri> GetUris(this IHost host) 34public static string MakeUrl(this IHost host, string scheme)
WebHostTests.cs (7)
74using (var host = builder.Build()) 130using var host = builder.Build(); 165using var host = builder.Build(); 202using var host = builder.Build(); 240using var host = builder.Build(); 311using var host = builder.Build(); 406using var host = builder.Build();
Microsoft.AspNetCore.Session.Tests (21)
SessionTests.cs (21)
28using var host = new HostBuilder() 64using var host = new HostBuilder() 112using var host = new HostBuilder() 165using var host = new HostBuilder() 214using var host = new HostBuilder() 273using var host = new HostBuilder() 335using var host = new HostBuilder() 382using var host = new HostBuilder() 447using var host = new HostBuilder() 512using var host = new HostBuilder() 554using var host = new HostBuilder() 603using var host = new HostBuilder() 644using var host = new HostBuilder() 694using var host = new HostBuilder() 743using var host = new HostBuilder() 791using var host = new HostBuilder() 845using var host = new HostBuilder() 905using var host = new HostBuilder() 971using var host = new HostBuilder() 1035using var host = new HostBuilder() 1091using var host = new HostBuilder()
Microsoft.AspNetCore.SignalR.Tests (12)
MapSignalRTests.cs (12)
23using (var host = BuildWebHost(routes => routes.MapHub<InvalidHub>("/overloads"))) 65using (var host = builder.Build()) 77using (var host = BuildWebHost(routes => routes.MapHub<AuthHub>("/path", options => 108using (var host = BuildWebHost(routes => routes.MapHub<AuthHub>("/path", options => 149using (var host = BuildWebHost(routes => routes.MapHub<InheritedAuthHub>("/path", options => 178using (var host = BuildWebHost(routes => routes.MapHub<DoubleAuthHub>("/path", options => 207using (var host = BuildWebHost(routes => routes.MapHub<AuthHub>("/path", options => 237using (var host = BuildWebHost(routes => routes.MapHub<AuthHub>("/path", options => 274using (var host = BuildWebHost(ConfigureRoutes)) 313using (var host = BuildWebHost(ConfigureRoutes)) 344using (var host = BuildWebHost(ConfigureRoutes)) 395private IHost BuildWebHost(Action<IEndpointRouteBuilder> configure)
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
src\Shared\SignalR\InProcessTestServer.cs (1)
40private IHost _host;
Microsoft.AspNetCore.StaticFiles.FunctionalTests (9)
FallbackStaticFileTest.cs (2)
23using var host = new HostBuilder() 76using var host = new HostBuilder()
Helpers.cs (1)
13public static string GetAddress(IHost server)
StaticFileMiddlewareTests.cs (6)
24using var host = new HostBuilder() 47using var host = new HostBuilder() 93using var host = new HostBuilder() 138using var host = new HostBuilder() 180using var host = new HostBuilder() 242using var host = new HostBuilder()
Microsoft.AspNetCore.StaticFiles.Tests (76)
CacheHeaderTests.cs (21)
17using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 28using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 48using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 60using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 74using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 86using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 112using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 126using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 140using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 164using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 188using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 207using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 233using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 282using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 297using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 319using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 338using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 366using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 385using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 400using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 415using var host = await StaticFilesTestServer.Create(app => app.UseFileServer());
DefaultFilesMiddlewareTests.cs (7)
24using var host = await StaticFilesTestServer.Create(app => app.UseDefaultFiles((string)null)); 62using var host = await StaticFilesTestServer.Create(app => 85using var host = await StaticFilesTestServer.Create( 128using var host = await StaticFilesTestServer.Create( 210using var host = await StaticFilesTestServer.Create(app => 257using var host = await StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions 312using var host = await StaticFilesTestServer.Create(app => app.UseDefaultFiles(new DefaultFilesOptions
DirectoryBrowserMiddlewareTests.cs (9)
20using var host = await StaticFilesTestServer.Create( 42using var host = await StaticFilesTestServer.Create( 83using var host = await StaticFilesTestServer.Create( 102using var host = await StaticFilesTestServer.Create( 143using var host = await StaticFilesTestServer.Create( 216using var host = await StaticFilesTestServer.Create( 260using var host = await StaticFilesTestServer.Create( 310using var host = await StaticFilesTestServer.Create( 358using var host = await StaticFilesTestServer.Create(
RangeHeaderTests.cs (22)
19using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 40using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 61using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 78using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 95using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 112using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 133using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 150using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 167using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 186using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 206using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 233using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 268using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 289using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 310using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 324using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 342using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 357using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 377using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 399using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 420using var host = await StaticFilesTestServer.Create(app => app.UseFileServer()); 440using var host = await StaticFilesTestServer.Create(app => app.UseFileServer());
StaticFileMiddlewareTests.cs (15)
25using var host = new HostBuilder() 58using var host = new HostBuilder() 90using var host = new HostBuilder() 123using var host = await StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions 150using var host = await StaticFilesTestServer.Create(app => app.UseStaticFiles((string)null)); 179using var host = await StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions 214using var host = await StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions 254using var host = await StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions 297using var host = await StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions 342using var host = await StaticFilesTestServer.Create(app => 390using var host = await StaticFilesTestServer.Create(app => 420using var host = await StaticFilesTestServer.Create(app => 446using var host = await StaticFilesTestServer.Create(app => 472using var host = await StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions 532using var host = await StaticFilesTestServer.Create(app => app.UseStaticFiles(new StaticFileOptions
StaticFilesTestServer.cs (2)
15public static async Task<IHost> Create(Action<IApplicationBuilder> configureApp, Action<IServiceCollection> configureServices = null) 24var host = new HostBuilder()
Microsoft.AspNetCore.TestHost (3)
HostBuilderTestServerExtensions.cs (3)
12/// Contains extensions for retrieving properties from <see cref="IHost"/>. 21public static TestServer GetTestServer(this IHost host) 31public static HttpClient GetTestClient(this IHost host)
Microsoft.AspNetCore.TestHost.Tests (27)
RequestLifetimeTests.cs (5)
19using var host = await CreateHost(async httpContext => 37using var host = await CreateHost(async httpContext => 54using var host = await CreateHost(async httpContext => 77using var host = await CreateHost(async httpContext => 97private Task<IHost> CreateHost(RequestDelegate appDelegate)
ResponseBodyTests.cs (8)
19using var host = await CreateHost(httpContext => 36using var host = await CreateHost(async httpContext => 53using var host = await CreateHost(async httpContext => 69using var host = await CreateHost(async httpContext => 88using var host = await CreateHost(async httpContext => 107using var host = await CreateHost(async httpContext => 129using var host = await CreateHost(async httpContext => 157private Task<IHost> CreateHost(RequestDelegate appDelegate)
ResponseResetTests.cs (8)
21using var host = await CreateHost(httpContext => 37using var host = await CreateHost(httpContext => 53using var host = await CreateHost(httpContext => 70using var host = await CreateHost(async httpContext => 91using var host = await CreateHost(async httpContext => 111using var host = await CreateHost(async httpContext => 137using var host = await CreateHost(async httpContext => 160private Task<IHost> CreateHost(RequestDelegate appDelegate)
TestServerTests.cs (6)
26using var host = new HostBuilder() 46using var host = await new HostBuilder() 62using var host = await new HostBuilder() 78using var host = await new HostBuilder() 343using var host = await new HostBuilder() 366using var host = await new HostBuilder()
Microsoft.AspNetCore.Testing (4)
ServiceFakesHostExtensions.cs (4)
29/// <param name="host">An <see cref="IHost"/> instance.</param> 35public static HttpClient CreateClient(this IHost host, HttpMessageHandler? handler = null, Func<Uri, bool>? addressFilter = null) 61/// <param name="host">An <see cref="IHost"/> instance.</param> 63public static IEnumerable<Uri> GetListenUris(this IHost host)
Microsoft.AspNetCore.Testing.Tests (10)
FakesExtensionsTests.cs (10)
32using var host = FakeHost.CreateBuilder() 42using var host = await FakeHost.CreateBuilder() 52using var host = await FakeHost.CreateBuilder() 73using var host = await FakeHost.CreateBuilder() 129var exception = Record.Exception(() => ((IHost)null!).CreateClient(new TestHandler(), _ => true)); 158using var host = await FakeHost.CreateBuilder() 170using var host = await FakeHost.CreateBuilder() 210var exception = Record.Exception(() => ((IHost)null!).GetListenUris()); 232private static Mock<IHost> CreateHostMock(params string[] addresses) 249var hostMock = new Mock<IHost>();
Microsoft.AspNetCore.WebSockets.Tests (5)
Http2WebSocketTests.cs (1)
19using var host = new HostBuilder()
IHostPortExtensions.cs (3)
13public static int GetPort(this IHost host) 18public static IEnumerable<int> GetPorts(this IHost host) 24public static IEnumerable<Uri> GetUris(this IHost host)
KestrelWebSocketHelpers.cs (1)
54var host = new HostBuilder()
Microsoft.Extensions.AmbientMetadata.Application.Tests (1)
AcceptanceTests.cs (1)
44using var host = await FakeHost.CreateBuilder()
Microsoft.Extensions.Diagnostics.Probes.Tests (15)
KubernetesProbesExtensionsTests.cs (4)
31using var host = CreateWebHost((services) => 70using var host = CreateWebHost((services) => 103using var host = CreateWebHost((services) => 120private static IHost CreateWebHost(Action<IServiceCollection> configureServices)
KubernetesProbesOptionsValidatorTests.cs (3)
71using IHost host = CreateHost(services => 102using IHost host = CreateHost(services => 118private static IHost CreateHost(Action<IServiceCollection> configureServices)
TcpEndpointProbesExtensionsTests.cs (8)
29using var host = CreateWebHost(services => 44using var host = CreateWebHost(services => 66using var host = CreateWebHost(services => 81using var host = CreateWebHost(services => 111using var host = CreateWebHost(services => 136using var host = CreateWebHost(services => 156using var host = CreateWebHost(services => 175private static IHost CreateWebHost(Action<IServiceCollection> configureServices)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (6)
Linux\AcceptanceTest.cs (2)
226using var host = FakeHost.CreateBuilder() 309using var host = FakeHost.CreateBuilder()
ResourceMonitoringExtensionsTests.cs (4)
91using var host = FakeHost.CreateBuilder() 120using var host = FakeHost.CreateBuilder() 164using var host = FakeHost.CreateBuilder() 186using var host = FakeHost.CreateBuilder()
Microsoft.Extensions.Hosting (28)
BackgroundServiceExceptionBehavior.cs (4)
7/// Specifies a behavior that the <see cref="IHost"/> will honor if an 13/// Stops the <see cref="IHost"/> instance. 16/// If a <see cref="BackgroundService"/> throws an exception, the <see cref="IHost"/> instance stops, and the process continues. 24/// If a <see cref="BackgroundService"/> throws an exception, the <see cref="IHost"/> will log the error, but otherwise ignore it.
HostApplicationBuilder.cs (3)
231/// <returns>An initialized <see cref="IHost"/>.</returns> 232public IHost Build() 342public IHost Build() => throw new NotSupportedException();
HostApplicationBuilderSettings.cs (1)
50/// <see cref="IHost"/> disposes the <see cref="ConfigurationManager"/>.
HostBuilder.cs (7)
74/// subsequent operations, as well as in <see cref="IHost.Services"/>. 150/// <returns>An initialized <see cref="IHost"/>.</returns> 152public IHost Build() 314services.AddSingleton<IHost>(_ => 366internal static IHost ResolveHost(IServiceProvider serviceProvider, DiagnosticListener diagnosticListener) 377var host = serviceProvider.GetRequiredService<IHost>();
HostingHostBuilderExtensions.cs (3)
115/// Adds a delegate for configuring the <see cref="HostOptions"/> of the <see cref="IHost"/>. 127/// Adds a delegate for configuring the <see cref="HostOptions"/> of the <see cref="IHost"/>. 140/// subsequent operations, as well as in <see cref="IHost.Services"/>.
HostOptions.cs (10)
12/// Options for <see cref="IHost"/>. 17/// Gets or sets the default timeout for <see cref="IHost.StopAsync(CancellationToken)"/>. 27/// Gets or sets the default timeout for <see cref="IHost.StartAsync(CancellationToken)"/>. 37/// Gets or sets a value that indicates if the <see cref="IHost"/> will start registered instances of <see cref="IHostedService"/> concurrently or sequentially. 40/// <see langword="true"/> if the <see cref="IHost"/> will start registered instances of <see cref="IHostedService"/> concurrently; <see langword="false"/> if the <see cref="IHost"/> will start registered instances sequentially. The default is <see langword="false"/> . 45/// Gets or sets a value that indicates if the <see cref="IHost"/> will stop registered instances of <see cref="IHostedService"/> concurrently or sequentially. 48/// <see langword="true"/> if the <see cref="IHost"/> will stop registered instances of <see cref="IHostedService"/> concurrently; <see langword="false"/> if the <see cref="IHost"/> will stop registered instances sequentially. The default is <see langword="false"/> . 53/// Gets or sets the behavior the <see cref="IHost"/> will follow when any of
Microsoft.Extensions.Hosting.Abstractions (30)
HostAbortedException.cs (1)
9/// The exception that is thrown upon <see cref="IHost"/> abortion.
HostBuilderContext.cs (4)
11/// Context containing the common services on the <see cref="IHost" />. Some properties may be null until set by the <see cref="IHost" />. 27/// The <see cref="IHostEnvironment" /> initialized by the <see cref="IHost" />. 32/// The <see cref="IConfiguration" /> containing the merged configuration of the application and the <see cref="IHost" />.
HostingAbstractionsHostBuilderExtensions.cs (5)
18/// <returns>The started <see cref="IHost"/>.</returns> 19public static IHost Start(this IHostBuilder hostBuilder) 29/// <returns>The started <see cref="IHost"/>.</returns> 30public static async Task<IHost> StartAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default) 32IHost host = hostBuilder.Build();
HostingAbstractionsHostExtensions.cs (13)
12/// Provides extension methods for the <see cref="IHost"/> from the hosting abstractions package. 19/// <param name="host">The <see cref="IHost"/> to start.</param> 20public static void Start(this IHost host) 28/// <param name="host">The <see cref="IHost"/> to stop.</param> 32public static async Task StopAsync(this IHost host, TimeSpan timeout) 41/// <param name="host">The running <see cref="IHost"/>.</param> 42public static void WaitForShutdown(this IHost host) 50/// <param name="host">The <see cref="IHost"/> to run.</param> 51public static void Run(this IHost host) 60/// <param name="host">The <see cref="IHost"/> to run.</param> 63public static async Task RunAsync(this IHost host, CancellationToken token = default) 87/// <param name="host">The running <see cref="IHost"/>.</param> 90public static async Task WaitForShutdownAsync(this IHost host, CancellationToken token = default)
IHost.cs (2)
25/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> starts.</returns> 32/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> stops.</returns>
IHostBuilder.cs (3)
33/// subsequent operations, as well as in <see cref="IHost.Services"/>. 76/// <returns>An initialized <see cref="IHost"/>.</returns> 77IHost Build();
IHostLifetime.cs (2)
15/// Called at the start of <see cref="IHost.StartAsync(CancellationToken)"/> which will wait until it's complete before 23/// Called from <see cref="IHost.StopAsync(CancellationToken)"/> to indicate that the host is stopping and it's time to shut down.
Microsoft.Extensions.Hosting.Systemd (5)
SystemdHostBuilderExtensions.cs (3)
17/// Configures the <see cref="IHost"/> lifetime to <see cref="SystemdLifetime"/>, 48/// Configures the lifetime of the <see cref="IHost"/> built from <paramref name="services"/> to 63/// The <see cref="IServiceCollection"/> used to build the <see cref="IHost"/>.
SystemdLifetime.cs (2)
51/// Asynchronously stops and shuts down the host. This method is called from <see cref="IHost.StopAsync(CancellationToken)" />. 65/// Asynchronously waits until the start operation is complete before continuing. This method is called at the beginning of <see cref="IHost.StartAsync(CancellationToken)" />. This can be used to delay startup until signaled by an external event.
Microsoft.Extensions.Hosting.Testing (13)
FakeHost.cs (5)
21private readonly IHost _host; 25internal FakeHost(IHost host, FakeHostOptions options) 66/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> starts.</returns> 89/// <returns>A <see cref="Task"/> that will be completed when the <see cref="IHost"/> stops.</returns> 109/// Disposes the <see cref="IHost"/> instance.
FakeHostBuilder.cs (1)
91public IHost Build() => new FakeHost(_builder.Build(), _options);
FakeHostingExtensions.cs (4)
49/// <param name="host">An <see cref="IHost"/> instance.</param> 52public static FakeLogCollector GetFakeLogCollector(this IHost host) 61/// <param name="host">An <see cref="IHost"/> instance.</param> 64public static FakeRedactionCollector GetFakeRedactionCollector(this IHost host)
HostTerminatorService.cs (3)
20private readonly IHost _host; 27/// <param name="host">The <see cref="IHost"/> instance.</param> 30public HostTerminatorService(IHost host, FakeHostOptions options, ILogger<HostTerminatorService> logger)
Microsoft.Extensions.Hosting.Testing.Tests (19)
FakeHostTests.cs (11)
21using var host = await FakeHost.CreateBuilder().StartAsync(); 28using var host = await FakeHost 36Assert.Throws<ObjectDisposedException>(() => host.Services.GetService<IHost>()); 42var hostMock = new Mock<IHost>(MockBehavior.Strict); 60var hostMock = new Mock<IHost>(MockBehavior.Strict); 79var hostMock = new Mock<IHost>(MockBehavior.Strict); 102var hostMock = new Mock<IHost>(MockBehavior.Strict); 119var hostMock = new Mock<IHost>(MockBehavior.Strict); 139var hostMock = new Mock<IHost>(MockBehavior.Strict); 162var hostMock = new Mock<IHost>(MockBehavior.Strict); 175var hostMock = new Mock<IHost>();
HostingFakesExtensionsTests.cs (5)
42using var host = await FakeHost.CreateBuilder().StartAsync(); 49using var host = new HostBuilder().Build(); 61using var host = await FakeHost.CreateBuilder().StartAsync(); 71using var host = new HostBuilder().Build(); 316using var host = await FakeHost.CreateBuilder()
HostTerminatorServiceTests.cs (3)
20var hostMock = new Mock<IHost>(MockBehavior.Strict); 35var hostMock = new Mock<IHost>(MockBehavior.Strict); 56var hostMock = new Mock<IHost>(MockBehavior.Strict);
Microsoft.Extensions.Hosting.WindowsServices (6)
WindowsServiceLifetime.cs (2)
67/// Asynchronously waits until start is complete before continuing. This method is called at the beginning of <see cref="IHost.StartAsync(CancellationToken)" />. This can be used to delay startup until signaled by an external event. 112/// Asynchronously stops and shuts down the host. This method is called from <see cref="IHost.StopAsync(CancellationToken)" />.
WindowsServiceLifetimeHostBuilderExtensions.cs (4)
61/// Configures the lifetime of the <see cref="IHost"/> built from <paramref name="services"/> to 70/// The <see cref="IServiceCollection"/> used to build the <see cref="IHost"/>. 81/// Configures the lifetime of the <see cref="IHost"/> built from <paramref name="services"/> to 89/// The <see cref="IServiceCollection"/> used to build the <see cref="IHost"/>.
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\HttpClientLoggingExtensionsTest.cs (1)
201using var host = FakeHost.CreateBuilder()
Microsoft.Extensions.Options.Contextual.Tests (1)
AcceptanceTests.cs (1)
84using var host = FakeHost.CreateBuilder()
Microsoft.Extensions.Telemetry.Tests (6)
Enrichment\ApplicationEnricherExtensionsTests.cs (3)
37using var host = FakeHost.CreateBuilder() 49using var host = FakeHost.CreateBuilder() 74using var host = FakeHost.CreateBuilder()
Enrichment\ProcessEnricherExtensionsTests.cs (3)
40using var host = FakeHost.CreateBuilder() 52using var host = FakeHost.CreateBuilder() 74using var host = FakeHost.CreateBuilder()
MiddlewareAnalysisSample (1)
Startup.cs (1)
81var host = new HostBuilder()
NativeIISSample (1)
Startup.cs (1)
143var host = new HostBuilder()
Negotiate.Server (2)
Program.cs (2)
15using var host1 = CreateHostBuilder(args.Append("Persist=true").ToArray()).Build(); 16using var host2 = CreateHostBuilder(args.Append("Persist=false").ToArray()).Build();
OpenIdConnectSample (1)
Program.cs (1)
10var host = Host.CreateDefaultBuilder(args)
OrderProcessor (1)
Program.cs (1)
10var host = builder.Build();
PlaintextApp (1)
Startup.cs (1)
38var host = new HostBuilder()
QueueSharing (1)
Program.cs (1)
40var host = new HostBuilder()
RequestDecompressionSample (1)
Startup.cs (1)
33var host = new HostBuilder()
ResponseCachingSample (1)
Startup.cs (1)
33var host = new HostBuilder()
ResponseCompressionSample (1)
Startup.cs (1)
68var host = new HostBuilder()
RewriteSample (1)
Startup.cs (1)
42var host = new HostBuilder()
RoutingSandbox (1)
Program.cs (1)
13var host = GetHostBuilder(args).Build();
RoutingWebSite (1)
Program.cs (1)
15var host = GetHostBuilder(args).Build();
SampleStartups (6)
StartupBlockingOnStart.cs (1)
37var host = new HostBuilder()
StartupConfigureAddresses.cs (1)
30var host = new HostBuilder()
StartupExternallyControlled.cs (1)
15private IHost _host;
StartupFullControl.cs (1)
24var host = new HostBuilder()
StartupHelloWorld.cs (1)
27var host = new HostBuilder()
StartupInjection.cs (1)
25var host = new HostBuilder()
SessionSample (1)
Startup.cs (1)
79var host = new HostBuilder()
SignalRSamples (1)
Program.cs (1)
18var host = Host.CreateDefaultBuilder(args)
SocialWeather (1)
Program.cs (1)
10var host = Host.CreateDefaultBuilder(args)
Sockets.BindTests (26)
SocketTransportOptionsTests.cs (2)
34using var host = CreateWebHost( 111private IHost CreateWebHost(EndPoint endpoint, Action<SocketTransportOptions> configureSocketOptions) =>
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (4)
17public static int GetPort(this IHost host) 22public static IEnumerable<int> GetPorts(this IHost host) 28public static IEnumerable<Uri> GetUris(this IHost host) 34public static string MakeUrl(this IHost host, string scheme)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
32private readonly IHost _host;
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (19)
199using (var host = hostBuilder.Build()) 257using (var host = hostBuilder.Build()) 324using (var host = hostBuilder.Build()) 382using (var host = hostBuilder.Build()) 429using (var host = hostBuilder.Build()) 516using (var host = hostBuilder.Build()) 554using (var host = hostBuilder.Build()) 589using (var host = hostBuilder.Build()) 624using (var host = hostBuilder.Build()) 669using (var host = hostBuilder.Build()) 710using (var host = hostBuilder.Build()) 756using (var host = hostBuilder.Build()) 781using (var host = hostBuilder.Build()) 807using (var host = hostBuilder.Build()) 827using (var host = hostBuilder.Build()) 858using (var host = hostBuilder.Build()) 880using (var host = hostBuilder.Build()) 917using (var host = hostBuilder.Build()) 971using (var host = hostBuilder.Build())
Sockets.FunctionalTests (20)
SocketTransportTests.cs (1)
50using var host = builder.Build();
src\Servers\Kestrel\shared\test\TransportTestHelpers\IHostPortExtensions.cs (4)
17public static int GetPort(this IHost host) 22public static IEnumerable<int> GetPorts(this IHost host) 28public static IEnumerable<Uri> GetUris(this IHost host) 34public static string MakeUrl(this IHost host, string scheme)
src\Servers\Kestrel\shared\test\TransportTestHelpers\TestServer.cs (1)
32private readonly IHost _host;
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)
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (6)
112using (var host = builder.Build()) 179using (var host = builder.Build()) 564using (var host = builder.Build()) 611using (var host = builder.Build()) 705using (var host = builder.Build()) 1118using (var host = builder.Build())
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (2)
72using (var host = hostBuilder.Build()) 121using (var host = hostBuilder.Build())
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (2)
93using (var host = hostBuilder.Build()) 159using (var host = hostBuilder.Build())
StaticFileSample (1)
Startup.cs (1)
26var host = new HostBuilder()
StatusCodePagesSample (1)
Startup.cs (1)
109var host = new HostBuilder()
Stress.TelemetryService (1)
Program.cs (1)
19var app = builder.Build();
TestProject.WorkerA (1)
Program.cs (1)
9using var host = builder.Build();
Wasm.Performance.Driver (4)
Program.cs (4)
68using var benchmarkReceiver = StartBenchmarkResultReceiver(); 284static IHost StartBenchmarkResultReceiver() 288var host = Host.CreateDefaultBuilder(args) 326static string GetListeningUrl(IHost testApp)
WelcomePageSample (1)
Startup.cs (1)
15var host = new HostBuilder()
WsFedSample (1)
Program.cs (1)
14var host = new HostBuilder()