6 implementations of IHostBuilder
Microsoft.AspNetCore (2)
BootstrapHostBuilder.cs (1)
12internal sealed class BootstrapHostBuilder : IHostBuilder
ConfigureHostBuilder.cs (1)
16public sealed class ConfigureHostBuilder : IHostBuilder, ISupportsConfigureWebHost
Microsoft.AspNetCore.Mvc.Testing (1)
DeferredHostBuilder.cs (1)
11internal sealed class DeferredHostBuilder : IHostBuilder
Microsoft.Extensions.Hosting (2)
HostApplicationBuilder.cs (1)
254private sealed class HostBuilderAdapter : IHostBuilder
HostBuilder.cs (1)
22public partial class HostBuilder : IHostBuilder
Microsoft.Extensions.Hosting.Testing (1)
FakeHostBuilder.cs (1)
14internal sealed class FakeHostBuilder : IHostBuilder
562 references to IHostBuilder
AutobahnTestApp (1)
Program.cs (1)
17var builder = new HostBuilder()
BasicLinkedApp (1)
Program.cs (1)
21private static IHostBuilder CreateWebHostBuilder(string[] args)
Benchmarks (2)
Program.cs (2)
15public static IHostBuilder GetHostBuilder(string[] args) 25var hostBuilder = new HostBuilder()
Binding.UDS.IntegrationTests (1)
ServiceHelper.cs (1)
23var hostBuilder = Host.CreateDefaultBuilder(Array.Empty<string>());
BlazorServerApp (1)
Program.cs (1)
13public static IHostBuilder CreateHostBuilder(string[] args) =>
Certificate.Optional.Sample (1)
Program.cs (1)
20public static IHostBuilder CreateHostBuilder(string[] args) =>
Certificate.Sample (1)
Program.cs (1)
15public static IHostBuilder CreateHostBuilder(string[] args) =>
CustomAuthorizationFailureResponse (1)
Program.cs (1)
16public static IHostBuilder CreateHostBuilder(string[] args) =>
DefaultBuilder.SampleApp (1)
Program.cs (1)
106public static IHostBuilder CreateHostBuilder(string[] args) =>
DelegationSite (1)
Program.cs (1)
10var builder = Host.CreateDefaultBuilder(args)
GenericHostWebSite (1)
Program.cs (1)
12public static IHostBuilder CreateHostBuilder(string[] args) =>
HeaderPropagationSample (1)
Program.cs (1)
13public static IHostBuilder CreateHostBuilder(string[] args) =>
HostedBlazorWebassemblyApp.Server (1)
Program.cs (1)
22public static IHostBuilder CreateHostBuilder(string[] args) =>
HostFilteringSample (1)
Program.cs (1)
15var hostBuilder = new HostBuilder()
http2cat (2)
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (2)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
Http2SampleApp (1)
Program.cs (1)
22var hostBuilder = new HostBuilder()
Http3SampleApp (1)
Program.cs (1)
19var hostBuilder = new HostBuilder()
HttpLogging.Sample (1)
Program.cs (1)
15public static IHostBuilder CreateHostBuilder(string[] args) =>
HttpStress (1)
Program.cs (1)
388var host = Host.CreateDefaultBuilder();
Identity.DefaultUI.WebSite (1)
Program.cs (1)
13public static IHostBuilder CreateHostBuilder(string[] args) =>
IdentitySample.DefaultUI (1)
Program.cs (1)
15public static IHostBuilder CreateHostBuilder(string[] args) =>
IIS.FunctionalTests (2)
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (2)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
IIS.LongTests (2)
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (2)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
IIS.NewHandler.FunctionalTests (2)
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (2)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
IIS.NewShim.FunctionalTests (2)
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (2)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
IISExpress.FunctionalTests (2)
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (2)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
InMemory.FunctionalTests (1)
TestTransport\TestServer.cs (1)
77var hostBuilder = new HostBuilder()
IntegrationTestsWebsite (1)
Program.cs (1)
13public static IHostBuilder CreateHostBuilder(string[] args) =>
Interop.FunctionalTests (86)
H2SpecTests.cs (1)
30var hostBuilder = new HostBuilder()
Http2\Http2RequestTests.cs (6)
30var builder = CreateHostBuilder( 97var builder = CreateHostBuilder( 167var builder = CreateHostBuilder( 202var builder = CreateHostBuilder(c => Task.CompletedTask, protocol: HttpProtocols.Http2, plaintext: true); 238var builder = CreateHostBuilder( 326private IHostBuilder CreateHostBuilder(RequestDelegate requestDelegate, HttpProtocols? protocol = null, Action<KestrelServerOptions> configureKestrel = null, bool? plaintext = null)
Http2WebSocketInteropTests.cs (2)
51var hostBuilder = new HostBuilder() 101var hostBuilder = new HostBuilder()
Http3\Http3RequestTests.cs (32)
77var builder = CreateHostBuilder(context => Task.CompletedTask); 133var builder = CreateHostBuilder(async context => 236var builder = CreateHostBuilder(async context => 281var builder = CreateHostBuilder(context => 326var builder = CreateHostBuilder(async context => 401var builder = CreateHostBuilder(async context => 458var builder = CreateHostBuilder(async context => 540var builder = CreateHostBuilder(async context => 599var builder = CreateHostBuilder(async context => 658var builder = CreateHostBuilder(async context => 708var builder = CreateHostBuilder(async context => 767var builder = CreateHostBuilder(context => 832var builder = CreateHostBuilder(context => 890var builder = CreateHostBuilder( 974var builder = CreateHostBuilder(async context => 1073var builder = CreateHostBuilder(async context => 1169var builder = CreateHostBuilder(async context => 1292var builder = CreateHostBuilder(async context => 1342var builder = CreateHostBuilder(async context => 1408var builder = CreateHostBuilder(context => 1462var builder = CreateHostBuilder(context => 1522var builder = CreateHostBuilder(async context => 1580var builder = CreateHostBuilder( 1631var builder = CreateHostBuilder( 1684var builder = CreateHostBuilder( 1753var builder = CreateHostBuilder( 1853var builder = CreateHostBuilder( 1944var builder = CreateHostBuilder(context => 1999var builder = CreateHostBuilder(async context => 2115var builder = CreateHostBuilder(async context => 2180var hostBuilder = CreateHostBuilder(context => 2203private IHostBuilder CreateHostBuilder(RequestDelegate requestDelegate, HttpProtocols? protocol = null, Action<KestrelServerOptions> configureKestrel = null, TimeSpan? shutdownTimeout = null)
Http3\Http3TlsTests.cs (9)
30var builder = CreateHostBuilder(async context => 80var builder = CreateHostBuilder(async context => 122var builder = CreateHostBuilder(async context => 167var builder = CreateHostBuilder(async context => 221var builder = CreateHostBuilder(async context => 263var builder = CreateHostBuilder(async context => 293var builder = CreateHostBuilder(async context => 446var hostBuilder = CreateHostBuilder(async context => 516private IHostBuilder CreateHostBuilder(RequestDelegate requestDelegate, HttpProtocols? protocol = null, Action<KestrelServerOptions> configureKestrel = null)
HttpClientHttp2InteropTests.cs (35)
53var hostBuilder = new HostBuilder() 74var hostBuilder = new HostBuilder() 107var hostBuilder = new HostBuilder() 155var hostBuilder = new HostBuilder() 262var hostBuilder = new HostBuilder() 321var hostBuilder = new HostBuilder() 403var hostBuilder = new HostBuilder() 519var hostBuilder = new HostBuilder() 549var hostBuilder = new HostBuilder() 584var hostBuilder = new HostBuilder() 609var hostBuilder = new HostBuilder() 637var hostBuilder = new HostBuilder() 664var hostBuilder = new HostBuilder() 700var hostBuilder = new HostBuilder() 756var hostBuilder = new HostBuilder() 814var hostBuilder = new HostBuilder() 860var hostBuilder = new HostBuilder() 905var hostBuilder = new HostBuilder() 946var hostBuilder = new HostBuilder() 986var hostBuilder = new HostBuilder() 1028var hostBuilder = new HostBuilder() 1080var hostBuilder = new HostBuilder() 1132var hostBuilder = new HostBuilder() 1193var hostBuilder = new HostBuilder() 1254var hostBuilder = new HostBuilder() 1314var hostBuilder = new HostBuilder() 1348var hostBuilder = new HostBuilder() 1381var hostBuilder = new HostBuilder() 1415var hostBuilder = new HostBuilder() 1457var hostBuilder = new HostBuilder() 1493var hostBuilder = new HostBuilder() 1551var hostBuilder = new HostBuilder() 1578var hostBuilder = new HostBuilder() 1601var hostBuilder = new HostBuilder() 1646var hostBuilder = new HostBuilder()
HttpHelpers.cs (1)
66public static IHostBuilder CreateHostBuilder(Action<IServiceCollection> configureServices, RequestDelegate requestDelegate, HttpProtocols? protocol = null, Action<KestrelServerOptions> configureKestrel = null, bool? plaintext = null, TimeSpan? shutdownTimeout = null)
InteropWebsite (1)
Program.cs (1)
30public static IHostBuilder CreateHostBuilder(string[] args) =>
Kestrel.SampleApp (1)
Startup.cs (1)
74var hostBuilder = new HostBuilder()
Logging.W3C.Sample (1)
Program.cs (1)
13public static IHostBuilder CreateHostBuilder(string[] args) =>
Microsoft.AspNetCore (30)
BootstrapHostBuilder.cs (6)
43public IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate) 49public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate) 55public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate) 67public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate) 73public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull 79public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
ConfigureHostBuilder.cs (9)
13/// A non-buildable <see cref="IHostBuilder"/> for <see cref="WebApplicationBuilder"/>. 38IHost IHostBuilder.Build() 44public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate) 52public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate) 62public IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate) 95public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate) 103public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull 112public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull 117IHostBuilder ISupportsConfigureWebHost.ConfigureWebHost(Action<IWebHostBuilder> configure, Action<WebHostBuilderOptions> configureOptions)
GenericHostBuilderExtensions.cs (11)
10/// Extension methods for configuring the <see cref="IHostBuilder" />. 15/// Configures a <see cref="IHostBuilder" /> with defaults for hosting a web app. This should be called 20/// The following defaults are applied to the <see cref="IHostBuilder"/>: 29/// <param name="builder">The <see cref="IHostBuilder" /> instance to configure.</param> 32public static IHostBuilder ConfigureWebHostDefaults(this IHostBuilder builder, Action<IWebHostBuilder> configure) 40/// Configures a <see cref="IHostBuilder" /> with defaults for hosting a web app. This should be called 45/// The following defaults are applied to the <see cref="IHostBuilder"/>: 54/// <param name="builder">The <see cref="IHostBuilder" /> instance to configure.</param> 58public static IHostBuilder ConfigureWebHostDefaults(this IHostBuilder builder, Action<IWebHostBuilder> configure, Action<WebHostBuilderOptions> configureOptions)
WebApplicationBuilder.cs (4)
34internal WebApplicationBuilder(WebApplicationOptions options, Action<IHostBuilder>? configureDefaults = null) 80internal WebApplicationBuilder(WebApplicationOptions options, bool slim, Action<IHostBuilder>? configureDefaults = null) 146internal WebApplicationBuilder(WebApplicationOptions options, bool slim, bool empty, Action<IHostBuilder>? configureDefaults = null) 361/// An <see cref="IHostBuilder"/> for configuring host specific properties, but not building.
Microsoft.AspNetCore.App.Analyzers.Test (1)
Verifiers\CSharpAnalyzerVerifier.cs (1)
73TrimAssemblyExtension(typeof(Microsoft.Extensions.Hosting.IHostBuilder).Assembly.Location),
Microsoft.AspNetCore.Authentication.Negotiate.Test (4)
EventTests.cs (1)
411var builder = new HostBuilder()
NegotiateHandlerTests.cs (2)
256var builder = new HostBuilder() 382var builder = new HostBuilder()
ServerDeferralTests.cs (1)
44var builder = new HostBuilder()
Microsoft.AspNetCore.DataProtection.Tests (2)
HostingTests.cs (2)
55var builder = new HostBuilder() 84var builder = new HostBuilder()
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Latency\ChecpointAcceptanceTests.cs (1)
23private static void SetupServices(IHostBuilder builder)
Microsoft.AspNetCore.Hosting (25)
GenericHost\GenericWebHostBuilder.cs (3)
29public GenericWebHostBuilder(IHostBuilder builder, WebHostBuilderOptions options) 299typeof(IHostBuilder).GetMethod(nameof(IHostBuilder.ConfigureContainer))!
GenericHost\SlimWebHostBuilder.cs (1)
20public SlimWebHostBuilder(IHostBuilder builder, WebHostBuilderOptions options)
GenericHost\WebHostBuilderBase.cs (2)
12private protected readonly IHostBuilder _builder; 15public WebHostBuilderBase(IHostBuilder builder, WebHostBuilderOptions options)
GenericHostWebHostBuilderExtensions.cs (16)
11/// Contains extensions for an <see cref="IHostBuilder"/>. 18/// <param name="builder">The <see cref="IHostBuilder"/> to add the <see cref="IWebHostBuilder"/> to.</param> 20/// <returns>The <see cref="IHostBuilder"/>.</returns> 21public static IHostBuilder ConfigureWebHost(this IHostBuilder builder, Action<IWebHostBuilder> configure) 31/// <param name="builder">The <see cref="IHostBuilder"/> to add the <see cref="IWebHostBuilder"/> to.</param> 34/// <returns>The <see cref="IHostBuilder"/>.</returns> 35public static IHostBuilder ConfigureWebHost(this IHostBuilder builder, Action<IWebHostBuilder> configure, Action<WebHostBuilderOptions> configureWebHostBuilder) 47/// <param name="builder">The <see cref="IHostBuilder"/> to add the <see cref="IWebHostBuilder"/> to.</param> 50/// <returns>The <see cref="IHostBuilder"/>.</returns> 51public static IHostBuilder ConfigureSlimWebHost(this IHostBuilder builder, Action<IWebHostBuilder> configure, Action<WebHostBuilderOptions> configureWebHostBuilder) 60private static IHostBuilder ConfigureWebHost( 61this IHostBuilder builder, 62Func<IHostBuilder, WebHostBuilderOptions, IWebHostBuilder> createWebHostBuilder,
Infrastructure\ISupportsConfigureWebHost.cs (3)
9/// An interface implemented by IWebHostBuilders that handle <see cref="GenericHostWebHostBuilderExtensions.ConfigureWebHost(IHostBuilder, Action{IWebHostBuilder})"/> 19/// <returns>The <see cref="IHostBuilder"/>.</returns> 20IHostBuilder ConfigureWebHost(Action<IWebHostBuilder> configure, Action<WebHostBuilderOptions> configureOptions);
Microsoft.AspNetCore.Hosting.Tests (2)
WebHostBuilderTests.cs (2)
1014var hostBuilder = new HostBuilder() 1028var hostBuilder = new HostBuilder()
Microsoft.AspNetCore.HttpLogging.Tests (2)
HttpLoggingMiddlewareTests.cs (2)
1906var builder = new HostBuilder() 2007var builder = new HostBuilder()
Microsoft.AspNetCore.Identity.FunctionalTests (2)
Infrastructure\ServerFactory.cs (2)
34protected override IHostBuilder CreateHostBuilder() 59protected override IHost CreateHost(IHostBuilder builder)
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
Infrastructure\MvcTestFixture.cs (1)
62protected override IHost CreateHost(IHostBuilder builder)
TestingInfrastructureInheritanceTests.cs (2)
150protected override IHost CreateHost(IHostBuilder builder) 162protected override IHostBuilder CreateHostBuilder()
Microsoft.AspNetCore.Mvc.Testing (26)
DeferredHostBuilder.cs (8)
15private Action<IHostBuilder> _configure; 56public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate) 62public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate) 68public IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate) 77public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate) 83public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull 89public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull 97_configure(((IHostBuilder)hostBuilder));
WebApplicationFactory.cs (18)
149var hostBuilder = CreateHostBuilder(); 189nameof(IHostBuilder), 205private void ConfigureHostBuilder(IHostBuilder hostBuilder) 384/// Creates a <see cref="IHostBuilder"/> used to set up <see cref="TestServer"/>. 391/// <returns>A <see cref="IHostBuilder"/> instance.</returns> 392protected virtual IHostBuilder? CreateHostBuilder() 394var hostBuilder = HostFactoryResolver.ResolveHostBuilderFactory<IHostBuilder>(typeof(TEntryPoint).Assembly)?.Invoke(Array.Empty<string>()); 424/// <see cref="IHostBuilder"/> will use <see cref="CreateHost"/> instead. 433/// This is only called for applications using <see cref="IHostBuilder"/>. Applications based on 436/// <param name="builder">The <see cref="IHostBuilder"/> used to create the host.</param> 438protected virtual IHost CreateHost(IHostBuilder builder) 610private readonly Func<IHostBuilder, IHost> _createHost; 612private readonly Func<IHostBuilder?> _createHostBuilder; 619Func<IHostBuilder, IHost> createHost, 621Func<IHostBuilder?> createHostBuilder, 638protected override IHost CreateHost(IHostBuilder builder) => _createHost(builder); 642protected override IHostBuilder? CreateHostBuilder() => _createHostBuilder();
Microsoft.AspNetCore.OpenApi.Tests (1)
Integration\SampleAppFixture.cs (1)
9protected override IHost CreateHost(IHostBuilder builder)
Microsoft.AspNetCore.OutputCaching.Tests (43)
OutputCacheTests.cs (41)
21foreach (var builder in builders) 43foreach (var builder in builders) 63foreach (var builder in builders) 83foreach (var builder in builders) 103foreach (var builder in builders) 125foreach (var builder in builders) 156foreach (var builder in builders) 187foreach (var builder in builders) 210foreach (var builder in builders) 237foreach (var builder in builders) 260foreach (var builder in builders) 288foreach (var builder in builders) 309foreach (var builder in builders) 333foreach (var builder in builders) 358foreach (var builder in builders) 381foreach (var builder in builders) 404foreach (var builder in builders) 427foreach (var builder in builders) 450foreach (var builder in builders) 472foreach (var builder in builders) 495foreach (var builder in builders) 517foreach (var builder in builders) 539foreach (var builder in builders) 559foreach (var builder in builders) 583foreach (var builder in builders) 608foreach (var builder in builders) 628foreach (var builder in builders) 652foreach (var builder in builders) 676foreach (var builder in builders) 702foreach (var builder in builders) 725foreach (var builder in builders) 751foreach (var builder in builders) 774foreach (var builder in builders) 801foreach (var builder in builders) 824foreach (var builder in builders) 847foreach (var builder in builders) 867foreach (var builder in builders) 891foreach (var builder in builders) 924foreach (var builder in builders) 944foreach (var builder in builders) 973foreach (var builder in builders)
TestUtils.cs (2)
101internal static IEnumerable<IHostBuilder> CreateBuildersWithOutputCaching( 131private static IEnumerable<IHostBuilder> CreateBuildersWithOutputCaching(
Microsoft.AspNetCore.ResponseCaching.Tests (39)
ResponseCachingTests.cs (37)
20foreach (var builder in builders) 44foreach (var builder in builders) 66foreach (var builder in builders) 88foreach (var builder in builders) 110foreach (var builder in builders) 134foreach (var builder in builders) 167foreach (var builder in builders) 200foreach (var builder in builders) 224foreach (var builder in builders) 248foreach (var builder in builders) 271foreach (var builder in builders) 294foreach (var builder in builders) 318foreach (var builder in builders) 340foreach (var builder in builders) 362foreach (var builder in builders) 384foreach (var builder in builders) 406foreach (var builder in builders) 428foreach (var builder in builders) 450foreach (var builder in builders) 472foreach (var builder in builders) 494foreach (var builder in builders) 520foreach (var builder in builders) 547foreach (var builder in builders) 569foreach (var builder in builders) 595foreach (var builder in builders) 621foreach (var builder in builders) 648foreach (var builder in builders) 673foreach (var builder in builders) 701foreach (var builder in builders) 726foreach (var builder in builders) 752foreach (var builder in builders) 777foreach (var builder in builders) 802foreach (var builder in builders) 824foreach (var builder in builders) 850foreach (var builder in builders) 885foreach (var builder in builders) 920foreach (var builder in builders)
TestUtils.cs (2)
116internal static IEnumerable<IHostBuilder> CreateBuildersWithResponseCaching( 141private static IEnumerable<IHostBuilder> CreateBuildersWithResponseCaching(
Microsoft.AspNetCore.Routing.FunctionalTests (2)
Benchmarks\EndpointRoutingBenchmarkTest.cs (1)
23var hostBuilder = Benchmarks.Program.GetHostBuilder(args);
Benchmarks\RouterBenchmarkTest.cs (1)
24var hostBuilder = Benchmarks.Program.GetHostBuilder(args);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (3)
src\Shared\Http2cat\Http2CatIHostBuilderExtensions.cs (2)
13public static IHostBuilder UseHttp2Cat(this IHostBuilder hostBuilder, string address, Func<Http2Utilities, Task> scenario)
Utilities.cs (1)
89var builder = new HostBuilder()
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.Tests (7)
WebHostTests.cs (7)
48var builder = new HostBuilder() 103var builder = new HostBuilder() 143var builder = new HostBuilder() 180var builder = new HostBuilder() 218var builder = new HostBuilder() 285var builder = new HostBuilder() 384var builder = new HostBuilder()
Microsoft.AspNetCore.Tests (8)
WebApplicationTests.cs (8)
46public delegate WebApplicationBuilder WebApplicationBuilderConstructorFunc(WebApplicationOptions options, Action<IHostBuilder> configureDefaults); 138private static WebApplicationBuilder WebApplicationBuilderConstructor(WebApplicationOptions options, Action<IHostBuilder> configureDefaults) 140private static WebApplicationBuilder WebApplicationSlimBuilderConstructor(WebApplicationOptions options, Action<IHostBuilder> configureDefaults) 142private static WebApplicationBuilder WebApplicationEmptyBuilderConstructor(WebApplicationOptions options, Action<IHostBuilder> configureDefaults) 373Assert.Throws<NotSupportedException>(() => ((IHostBuilder)createBuilder().Host).Build()); 2971private readonly Action<IHostBuilder> _configure; 2976public HostingListener(Action<IHostBuilder> configure) 3013_configure?.Invoke((IHostBuilder)value.Value);
Microsoft.Extensions.AmbientMetadata.Application (2)
ApplicationMetadataHostBuilderExtensions.cs (2)
26public static IHostBuilder UseApplicationMetadata(this IHostBuilder builder, string sectionName = DefaultSectionName)
Microsoft.Extensions.AmbientMetadata.Application.Tests (1)
ApplicationMetadataExtensionsTests.cs (1)
42Assert.Throws<ArgumentNullException>(() => ((IHostBuilder)null!).UseApplicationMetadata(_fixture.Create<string>()));
Microsoft.Extensions.Hosting (97)
Host.cs (5)
11/// Provides convenience methods for creating instances of <see cref="IHostBuilder"/> with pre-configured defaults. 30/// <returns>The initialized <see cref="IHostBuilder"/>.</returns> 31public static IHostBuilder CreateDefaultBuilder() => 52/// <returns>The initialized <see cref="IHostBuilder"/>.</returns> 53public static IHostBuilder CreateDefaultBuilder(string[]? args)
HostApplicationBuilder.cs (7)
252internal IHostBuilder AsHostBuilder() => _hostBuilderAdapter ??= new HostBuilderAdapter(this); 344public IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate) 352public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate) 360public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate) 368public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull 377public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull 385public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate)
HostApplicationBuilderSettings.cs (2)
27/// This has a similar effect to calling <see cref="HostingHostBuilderExtensions.ConfigureDefaults(IHostBuilder, string[])"/>. 30/// The following defaults are applied to the <see cref="IHostBuilder"/>:
HostBuilder.cs (13)
62/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 63public IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate) 78/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 79public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate) 92/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 93public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate) 106/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 107public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull 121/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 122public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull 138/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 139public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate) 173private static DiagnosticListener LogHostBuilding(IHostBuilder hostBuilder)
HostingHostBuilderExtensions.cs (70)
23/// Provides extension methods for the <see cref="IHostBuilder"/> from the hosting package. 31/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to configure.</param> 33/// <returns>The <see cref="IHostBuilder"/>.</returns> 34public static IHostBuilder UseEnvironment(this IHostBuilder hostBuilder, string environment) 51/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to configure.</param> 53/// <returns>The <see cref="IHostBuilder"/>.</returns> 54public static IHostBuilder UseContentRoot(this IHostBuilder hostBuilder, string contentRoot) 70/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to configure.</param> 72/// <returns>The <see cref="IHostBuilder"/>.</returns> 73public static IHostBuilder UseDefaultServiceProvider(this IHostBuilder hostBuilder, Action<ServiceProviderOptions> configure) 79/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to configure.</param> 81/// <returns>The <see cref="IHostBuilder"/>.</returns> 82public static IHostBuilder UseDefaultServiceProvider(this IHostBuilder hostBuilder, Action<HostBuilderContext, ServiceProviderOptions> configure) 95/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 97/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 98public static IHostBuilder ConfigureLogging(this IHostBuilder hostBuilder, Action<HostBuilderContext, ILoggingBuilder> configureLogging) 106/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 108/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 109public static IHostBuilder ConfigureLogging(this IHostBuilder hostBuilder, Action<ILoggingBuilder> configureLogging) 117/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 119/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 120public static IHostBuilder ConfigureHostOptions(this IHostBuilder hostBuilder, Action<HostBuilderContext, HostOptions> configureOptions) 129/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 131/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 132public static IHostBuilder ConfigureHostOptions(this IHostBuilder hostBuilder, Action<HostOptions> configureOptions) 142/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 145/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 146public static IHostBuilder ConfigureAppConfiguration(this IHostBuilder hostBuilder, Action<IConfigurationBuilder> configureDelegate) 154/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 156/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 157public static IHostBuilder ConfigureServices(this IHostBuilder hostBuilder, Action<IServiceCollection> configureDelegate) 167/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 169/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 170public static IHostBuilder ConfigureContainer<TContainerBuilder>(this IHostBuilder hostBuilder, Action<TContainerBuilder> configureDelegate) 176/// Configures an existing <see cref="IHostBuilder"/> instance with pre-configured defaults. This will overwrite 180/// The following defaults are applied to the <see cref="IHostBuilder"/>: 193/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 194public static IHostBuilder ConfigureDefaults(this IHostBuilder builder, string[]? args) 339/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 340/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 345public static IHostBuilder UseConsoleLifetime(this IHostBuilder hostBuilder) 354/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 356/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 361public static IHostBuilder UseConsoleLifetime(this IHostBuilder hostBuilder, Action<ConsoleLifetimeOptions> configureOptions) 373/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 380public static Task RunConsoleAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default) 388/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 396public static Task RunConsoleAsync(this IHostBuilder hostBuilder, Action<ConsoleLifetimeOptions> configureOptions, CancellationToken cancellationToken = default) 404/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 406/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 407public static IHostBuilder ConfigureMetrics(this IHostBuilder hostBuilder, Action<IMetricsBuilder> configureMetrics) 415/// <param name="hostBuilder">The <see cref="IHostBuilder" /> to configure.</param> 417/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 418public static IHostBuilder ConfigureMetrics(this IHostBuilder hostBuilder, Action<HostBuilderContext, IMetricsBuilder> configureMetrics)
Microsoft.Extensions.Hosting.Abstractions (18)
HostingAbstractionsHostBuilderExtensions.cs (5)
10/// Provides extension methods for the <see cref="IHostBuilder"/> from the hosting abstractions package. 17/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to start.</param> 19public static IHost Start(this IHostBuilder hostBuilder) 27/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to start.</param> 30public static async Task<IHost> StartAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default)
IHost.cs (1)
16/// Gets the services configured for the program (for example, using <see cref="IHostBuilder.ConfigureServices(Action{HostBuilderContext, Microsoft.Extensions.DependencyInjection.IServiceCollection})" />).
IHostBuilder.cs (12)
27/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 28IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate); 37/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 38IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate); 45/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 46IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate); 53/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 54IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) where TContainerBuilder : notnull; 61/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 62IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull; 70/// <returns>The same instance of the <see cref="IHostBuilder"/> for chaining.</returns> 71IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate);
Microsoft.Extensions.Hosting.Systemd (4)
SystemdHostBuilderExtensions.cs (4)
31/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to configure.</param> 33public static IHostBuilder UseSystemd(this IHostBuilder hostBuilder) 65/// <see cref="IHostBuilder.ConfigureServices(System.Action{HostBuilderContext, IServiceCollection})"/> callback.
Microsoft.Extensions.Hosting.Testing (44)
FakeHost.cs (9)
32/// Creates an instance of <see cref="IHostBuilder"/> to configure and build the host. 34/// <returns>An instance of <see cref="IHostBuilder"/>.</returns> 35public static IHostBuilder CreateBuilder() => new FakeHostBuilder(new FakeHostOptions()); 38/// Creates an instance of <see cref="IHostBuilder"/> to configure and build the host. 41/// <returns>An instance of <see cref="IHostBuilder"/>.</returns> 42public static IHostBuilder CreateBuilder(Action<FakeHostOptions> configure) 52/// Creates an instance of <see cref="IHostBuilder"/> to configure and build the host. 55/// <returns>An instance of <see cref="IHostBuilder"/>.</returns> 56public static IHostBuilder CreateBuilder(FakeHostOptions options)
FakeHostBuilder.cs (8)
16private readonly IHostBuilder _builder; 24internal FakeHostBuilder(IHostBuilder builder, FakeHostOptions options) 62public IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate) 67public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate) 72public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate) 77public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory) 83public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) 89public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate) => _builder.ConfigureContainer(configureDelegate);
FakeHostingExtensions.cs (27)
73/// <param name="builder">An <see cref="IHostBuilder"/> instance.</param> 75/// <returns>The <see cref="IHostBuilder"/> instance.</returns> 76public static IHostBuilder AddFakeLoggingOutputSink(this IHostBuilder builder, Action<string> callback) 100/// Exposes <see cref="IHostBuilder"/> for changes via a delegate. 102/// <param name="builder">An <see cref="IHostBuilder"/> instance.</param> 103/// <param name="configure">Configures the <see cref="IHostBuilder"/> instance.</param> 104/// <returns>The <see cref="IHostBuilder"/> instance.</returns> 108public static IHostBuilder Configure(this IHostBuilder builder, Action<IHostBuilder> configure) 119/// <param name="builder">An <see cref="IHostBuilder"/> instance.</param> 121/// <returns>The <see cref="IHostBuilder"/> instance.</returns> 122public static IHostBuilder ConfigureHostConfiguration(this IHostBuilder builder, params (string key, string value)[] configurations) 137/// <param name="builder">An <see cref="IHostBuilder"/> instance.</param> 140/// <returns>The <see cref="IHostBuilder"/> instance.</returns> 141public static IHostBuilder ConfigureHostConfiguration(this IHostBuilder builder, string key, string value) 150/// <param name="builder">An <see cref="IHostBuilder"/> instance.</param> 152/// <returns>The <see cref="IHostBuilder"/> instance.</returns> 153public static IHostBuilder ConfigureAppConfiguration(this IHostBuilder builder, params (string key, string value)[] configurations) 168/// <param name="builder">An <see cref="IHostBuilder"/> instance.</param> 171/// <returns>The <see cref="IHostBuilder"/> instance.</returns> 172public static IHostBuilder ConfigureAppConfiguration(this IHostBuilder builder, string key, string value)
Microsoft.Extensions.Hosting.Testing.Tests (24)
FakeHostBuilderTests.cs (15)
63var builderMock = new Mock<IHostBuilder>(); 67var returnedBuilder = builder.ConfigureHostConfiguration(configurationDelegate); 76var builderMock = new Mock<IHostBuilder>(); 80var returnedBuilder = builder.ConfigureAppConfiguration(configurationDelegate); 89var builderMock = new Mock<IHostBuilder>(); 102var builderMock = new Mock<IHostBuilder>(); 106var returnedBuilder = builder.ConfigureContainer(configurationDelegate); 115var builderMock = new Mock<IHostBuilder>(); 120var returnedBuilder = builder.UseServiceProviderFactory(factory); 128var hostBuilder = FakeHost.CreateBuilder() 146var hostBuilder = FakeHost.CreateBuilder(x => x.ValidateScopes = false) 161var hostBuilder = FakeHost.CreateBuilder() 178var hostBuilder = FakeHost.CreateBuilder(x => x.ValidateOnBuild = false) 194var builderMock = new Mock<IHostBuilder>(); 199var returnedBuilder = builder.UseServiceProviderFactory(functor);
HostingFakesExtensionsTests.cs (9)
82var builderMock = new Mock<IHostBuilder>(); 84var returnedBuilder = builderMock.Object.Configure(builder => builder.Build()); 93var exception = Record.Exception(() => ((IHostBuilder)null!).Configure(_ => { })); 107var builderMock = new Mock<IHostBuilder>(); 116var builderMock = new Mock<IHostBuilder>(); 121var returnedBuilder = builderMock.Object.ConfigureAppConfiguration("testKey", "testValue"); 307Assert.Throws<ArgumentNullException>(() => ((IHostBuilder)null!).AddFakeLoggingOutputSink(_ => { })); 328private static Mock<IHostBuilder> CreateHostBuilderMock( 332var builderMock = new Mock<IHostBuilder>();
Microsoft.Extensions.Hosting.WindowsServices (8)
WindowsServiceLifetimeHostBuilderExtensions.cs (8)
27/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to operate on.</param> 29public static IHostBuilder UseWindowsService(this IHostBuilder hostBuilder) 42/// <param name="hostBuilder">The <see cref="IHostBuilder"/> to operate on.</param> 45public static IHostBuilder UseWindowsService(this IHostBuilder hostBuilder, Action<WindowsServiceLifetimeOptions> configure) 72/// <see cref="IHostBuilder.ConfigureServices(Action{HostBuilderContext, IServiceCollection})"/> callback. 91/// <see cref="IHostBuilder.ConfigureServices(Action{HostBuilderContext, IServiceCollection})"/> callback.
Negotiate.Client (1)
Program.cs (1)
16public static IHostBuilder CreateHostBuilder(string[] args) =>
Negotiate.Server (1)
Program.cs (1)
23public static IHostBuilder CreateHostBuilder(string[] args) =>
NegotiateAuthSample (1)
Program.cs (1)
15public static IHostBuilder CreateHostBuilder(string[] args) =>
RoutingSandbox (1)
Program.cs (1)
18public static IHostBuilder GetHostBuilder(string[] args)
RoutingWebSite (1)
Program.cs (1)
20public static IHostBuilder GetHostBuilder(string[] args)
Sandbox (1)
Program.cs (1)
13public static IHostBuilder CreateHostBuilder(string[] args) =>
SelfHostServer (1)
Program.cs (1)
17public static IHostBuilder CreateHostBuilder(string[] args) =>
SignalR.Client.FunctionalTestApp (1)
Program.cs (1)
24var hostBuilder = new HostBuilder()
Sockets.BindTests (18)
src\Servers\Kestrel\test\BindTests\AddressRegistrationTests.cs (17)
183var hostBuilder = TransportSelector.GetHostBuilder() 233var hostBuilder = TransportSelector.GetHostBuilder() 306var hostBuilder = TransportSelector.GetHostBuilder() 370var hostBuilder = TransportSelector.GetHostBuilder() 417var hostBuilder = TransportSelector.GetHostBuilder() 501var hostBuilder = TransportSelector.GetHostBuilder() 544var hostBuilder = TransportSelector.GetHostBuilder() 579var hostBuilder = TransportSelector.GetHostBuilder() 607var hostBuilder = TransportSelector.GetHostBuilder() 652var hostBuilder = TransportSelector.GetHostBuilder() 694var hostBuilder = TransportSelector.GetHostBuilder() 746var hostBuilder = TransportSelector.GetHostBuilder() 771var hostBuilder = TransportSelector.GetHostBuilder() 795var hostBuilder = TransportSelector.GetHostBuilder() 845var hostBuilder = TransportSelector.GetHostBuilder() 898var hostBuilder = TransportSelector.GetHostBuilder() 961var hostBuilder = TransportSelector.GetHostBuilder()
src\Servers\Kestrel\test\Sockets.FunctionalTests\TransportSelector.cs (1)
13public static IHostBuilder GetHostBuilder(Func<MemoryPool<byte>> memoryPoolFactory = null,
Sockets.FunctionalTests (12)
SocketTransportTests.cs (1)
27var builder = TransportSelector.GetHostBuilder()
src\Servers\Kestrel\test\FunctionalTests\RequestTests.cs (6)
74var builder = TransportSelector.GetHostBuilder() 163var builder = TransportSelector.GetHostBuilder() 539var builder = TransportSelector.GetHostBuilder() 593var builder = TransportSelector.GetHostBuilder() 683var builder = TransportSelector.GetHostBuilder() 1095var builder = TransportSelector.GetHostBuilder()
src\Servers\Kestrel\test\FunctionalTests\ResponseTests.cs (2)
45var hostBuilder = TransportSelector.GetHostBuilder() 103var hostBuilder = TransportSelector.GetHostBuilder()
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (2)
78var hostBuilder = TransportSelector.GetHostBuilder() 143var hostBuilder = TransportSelector.GetHostBuilder()
TransportSelector.cs (1)
13public static IHostBuilder GetHostBuilder(Func<MemoryPool<byte>> memoryPoolFactory = null,
SystemdTestApp (1)
Startup.cs (1)
46var hostBuilder = new HostBuilder()