5 implementations of IWebHostBuilder
Microsoft.AspNetCore (1)
ConfigureWebHostBuilder.cs (1)
16public sealed class ConfigureWebHostBuilder : IWebHostBuilder, ISupportsStartup
Microsoft.AspNetCore.Hosting (3)
GenericHost\HostingStartupWebHostBuilder.cs (1)
15internal sealed class HostingStartupWebHostBuilder : IWebHostBuilder, ISupportsStartup, ISupportsUseDefaultServiceProvider
GenericHost\WebHostBuilderBase.cs (1)
10internal abstract class WebHostBuilderBase : IWebHostBuilder, ISupportsUseDefaultServiceProvider
WebHostBuilder.cs (1)
23public class WebHostBuilder : IWebHostBuilder
Microsoft.AspNetCore.Hosting.Tests (1)
Fakes\GenericWebHostBuilderWrapper.cs (1)
12public class GenericWebHostBuilderWrapper : IWebHostBuilder, ISupportsStartup, ISupportsUseDefaultServiceProvider
620 references to IWebHostBuilder
ApiExplorerWebSite (1)
Startup.cs (1)
54public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
ApplicationModelWebSite (1)
Startup.cs (1)
43public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
BasicWebSite (1)
Program.cs (1)
12public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
ClaimsTransformation (1)
Program.cs (1)
25public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
ControllersFromServicesWebSite (1)
Startup.cs (1)
70public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
Cookies (1)
Program.cs (1)
25public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
CorsWebSite (1)
Program.cs (1)
16public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
CustomPolicyProvider (1)
Program.cs (1)
16public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
DynamicSchemes (1)
Program.cs (1)
25public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
ErrorPageMiddlewareWebSite (1)
Startup.cs (1)
33public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
FilesWebSite (1)
Startup.cs (1)
32public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
FormatterWebSite (1)
Program.cs (1)
16public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
HtmlGenerationWebSite (2)
Startup.cs (1)
57public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
StartupWithCultureReplace.cs (1)
34public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
HttpStress (1)
Program.cs (1)
375Console.WriteLine(" ASP.NET Core: " + Path.GetFileName(Path.GetDirectoryName(typeof(IWebHostBuilder).Assembly.Location)));
Identity.ExternalClaims (1)
Program.cs (1)
23public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
IdentitySample.Mvc (1)
Program.cs (1)
15public static IWebHostBuilder CreateHostBuilder(string[] args) =>
Interop.FunctionalTests (4)
Http2WebSocketInteropTests.cs (1)
174private static void ConfigureKestrel(IWebHostBuilder webHostBuilder, string scheme, HttpProtocols protocols)
Http3\Http3TlsTests.cs (2)
348var hostBuilder = new WebHostBuilder() 403var hostBuilder = new WebHostBuilder()
HttpClientHttp2InteropTests.cs (1)
1706private static void ConfigureKestrel(IWebHostBuilder webHostBuilder, string scheme)
IStartupInjectionAssemblyName (1)
Program.cs (1)
20private static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
Microsoft.AspNetCore (26)
ConfigureHostBuilder.cs (1)
117IHostBuilder ISupportsConfigureWebHost.ConfigureWebHost(Action<IWebHostBuilder> configure, Action<WebHostBuilderOptions> configureOptions)
ConfigureWebHostBuilder.cs (10)
13/// A non-buildable <see cref="IWebHostBuilder"/> for <see cref="WebApplicationBuilder"/>. 31IWebHost IWebHostBuilder.Build() 37public IWebHostBuilder ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate) 88public IWebHostBuilder ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices) 96public IWebHostBuilder ConfigureServices(Action<IServiceCollection> configureServices) 108public IWebHostBuilder UseSetting(string key, string? value) 166IWebHostBuilder ISupportsStartup.Configure(Action<IApplicationBuilder> configure) 171IWebHostBuilder ISupportsStartup.Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure) 176IWebHostBuilder ISupportsStartup.UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType) 181IWebHostBuilder ISupportsStartup.UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
GenericHostBuilderExtensions.cs (2)
32public static IHostBuilder ConfigureWebHostDefaults(this IHostBuilder builder, Action<IWebHostBuilder> configure) 58public static IHostBuilder ConfigureWebHostDefaults(this IHostBuilder builder, Action<IWebHostBuilder> configure, Action<WebHostBuilderOptions> configureOptions)
WebApplicationBuilder.cs (2)
219private void InitializeWebHostSettings(IWebHostBuilder webHostBuilder) 355/// An <see cref="IWebHostBuilder"/> for configuring server specific properties, but not building.
WebHost.cs (11)
22/// Provides convenience methods for creating instances of <see cref="IWebHost"/> and <see cref="IWebHostBuilder"/> with pre-configured defaults. 91var builder = CreateDefaultBuilder(); 132/// <returns>The initialized <see cref="IWebHostBuilder"/>.</returns> 133public static IWebHostBuilder CreateDefaultBuilder() => 154/// <returns>The initialized <see cref="IWebHostBuilder"/>.</returns> 155public static IWebHostBuilder CreateDefaultBuilder(string[] args) 217internal static void ConfigureWebDefaults(IWebHostBuilder builder) 239internal static void ConfigureWebDefaultsSlim(IWebHostBuilder builder) 249private static void ConfigureWebDefaultsWorker(IWebHostBuilder builder, Action<IServiceCollection>? configureRouting) 302/// <returns>The initialized <see cref="IWebHostBuilder"/>.</returns> 303public static IWebHostBuilder CreateDefaultBuilder<[DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] TStartup>(string[] args) where TStartup : class =>
Microsoft.AspNetCore.AzureAppServices.HostingStartup (1)
AzureAppServicesHostingStartup.cs (1)
22public void Configure(IWebHostBuilder builder)
Microsoft.AspNetCore.AzureAppServicesIntegration (2)
AppServicesWebHostBuilderExtensions.cs (2)
18public static IWebHostBuilder UseAzureAppServices(this IWebHostBuilder hostBuilder)
Microsoft.AspNetCore.AzureAppServicesIntegration.Tests (1)
AppServicesWebHostBuilderExtensionsTest.cs (1)
14var mock = new Mock<IWebHostBuilder>();
Microsoft.AspNetCore.DataProtection.Tests (1)
HostingTests.cs (1)
28var builder = new WebHostBuilder()
Microsoft.AspNetCore.Hosting (106)
GenericHost\GenericWebHostBuilder.cs (4)
166public IWebHostBuilder UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType) 189public IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory) 312public IWebHostBuilder Configure(Action<IApplicationBuilder> configure) 335public IWebHostBuilder Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure)
GenericHost\HostingStartupWebHostBuilder.cs (10)
28throw new NotSupportedException($"Building this implementation of {nameof(IWebHostBuilder)} is not supported."); 31public IWebHostBuilder ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate) 37public IWebHostBuilder ConfigureServices(Action<IServiceCollection> configureServices) 42public IWebHostBuilder ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices) 50public IWebHostBuilder UseSetting(string key, string? value) 66public IWebHostBuilder UseDefaultServiceProvider(Action<WebHostBuilderContext, ServiceProviderOptions> configure) 71public IWebHostBuilder Configure(Action<IApplicationBuilder> configure) 76public IWebHostBuilder Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure) 81public IWebHostBuilder UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType) 88public IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
GenericHost\ISupportsUseDefaultServiceProvider.cs (1)
10IWebHostBuilder UseDefaultServiceProvider(Action<WebHostBuilderContext, ServiceProviderOptions> configure);
GenericHost\SlimWebHostBuilder.cs (4)
62public IWebHostBuilder Configure(Action<IApplicationBuilder> configure) 67public IWebHostBuilder UseStartup([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicMethods)] Type startupType) 72public IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory) 77public IWebHostBuilder Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure)
GenericHost\WebHostBuilderBase.cs (6)
31throw new NotSupportedException($"Building this implementation of {nameof(IWebHostBuilder)} is not supported."); 34public IWebHostBuilder ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate) 45public IWebHostBuilder ConfigureServices(Action<IServiceCollection> configureServices) 50public IWebHostBuilder ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices) 61public IWebHostBuilder UseDefaultServiceProvider(Action<WebHostBuilderContext, ServiceProviderOptions> configure) 102public IWebHostBuilder UseSetting(string key, string? value)
GenericHostWebHostBuilderExtensions.cs (12)
18/// <param name="builder">The <see cref="IHostBuilder"/> to add the <see cref="IWebHostBuilder"/> to.</param> 19/// <param name="configure">The delegate that configures the <see cref="IWebHostBuilder"/>.</param> 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> 32/// <param name="configure">The delegate that configures the <see cref="IWebHostBuilder"/>.</param> 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> 48/// <param name="configure">The delegate that configures the <see cref="IWebHostBuilder"/>.</param> 51public static IHostBuilder ConfigureSlimWebHost(this IHostBuilder builder, Action<IWebHostBuilder> configure, Action<WebHostBuilderOptions> configureWebHostBuilder) 62Func<IHostBuilder, WebHostBuilderOptions, IWebHostBuilder> createWebHostBuilder, 63Action<IWebHostBuilder> configure, 77var webhostBuilder = createWebHostBuilder(builder, webHostBuilderOptions);
Infrastructure\ISupportsConfigureWebHost.cs (3)
9/// An interface implemented by IWebHostBuilders that handle <see cref="GenericHostWebHostBuilderExtensions.ConfigureWebHost(IHostBuilder, Action{IWebHostBuilder})"/> 17/// <param name="configure">The delegate that configures the <see cref="IWebHostBuilder"/>.</param> 20IHostBuilder ConfigureWebHost(Action<IWebHostBuilder> configure, Action<WebHostBuilderOptions> configureOptions);
Infrastructure\ISupportsStartup.cs (11)
11/// An interface implemented by IWebHostBuilders that handle <see cref="WebHostBuilderExtensions.Configure(IWebHostBuilder, Action{IApplicationBuilder})"/>, 12/// <see cref="WebHostBuilderExtensions.UseStartup(IWebHostBuilder, Type)"/> and <see cref="WebHostBuilderExtensions.UseStartup{TStartup}(IWebHostBuilder, Func{WebHostBuilderContext, TStartup})"/> 21/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 22IWebHostBuilder Configure(Action<IApplicationBuilder> configure); 28/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 29IWebHostBuilder Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure); 35/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 36IWebHostBuilder UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType); 42/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 44IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory);
WebHostBuilder.cs (9)
79/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 80public IWebHostBuilder UseSetting(string key, string? value) 91/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 92public IWebHostBuilder ConfigureServices(Action<IServiceCollection> configureServices) 104/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 105public IWebHostBuilder ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices) 115/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 118/// The <see cref="IConfigurationBuilder"/> is pre-populated with the settings of the <see cref="IWebHostBuilder"/>. 120public IWebHostBuilder ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate)
WebHostBuilderExtensions.cs (46)
21/// Contains extensions for configuring an <see cref="IWebHostBuilder" />. 28/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 30/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 31public static IWebHostBuilder Configure(this IWebHostBuilder hostBuilder, Action<IApplicationBuilder> configureApp) 57/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 59/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 60public static IWebHostBuilder Configure(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, IApplicationBuilder> configureApp) 86/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 88/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 90public static IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(this IWebHostBuilder hostBuilder, Func<WebHostBuilderContext, TStartup> startupFactory) where TStartup : class 130/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 132/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 133public static IWebHostBuilder UseStartup(this IWebHostBuilder hostBuilder, [DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType) 168/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 170/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 171public static IWebHostBuilder UseStartup<[DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] TStartup>(this IWebHostBuilder hostBuilder) where TStartup : class 179/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 181/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 182public static IWebHostBuilder UseDefaultServiceProvider(this IWebHostBuilder hostBuilder, Action<ServiceProviderOptions> configure) 190/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 192/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 193public static IWebHostBuilder UseDefaultServiceProvider(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, ServiceProviderOptions> configure) 212/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 214/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 217/// The <see cref="IConfigurationBuilder"/> is pre-populated with the settings of the <see cref="IWebHostBuilder"/>. 219public static IWebHostBuilder ConfigureAppConfiguration(this IWebHostBuilder hostBuilder, Action<IConfigurationBuilder> configureDelegate) 227/// <param name="hostBuilder">The <see cref="IWebHostBuilder" /> to configure.</param> 229/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 230public static IWebHostBuilder ConfigureLogging(this IWebHostBuilder hostBuilder, Action<ILoggingBuilder> configureLogging) 238/// <param name="hostBuilder">The <see cref="IWebHostBuilder" /> to configure.</param> 240/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 241public static IWebHostBuilder ConfigureLogging(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, ILoggingBuilder> configureLogging) 250/// <param name="builder">The <see cref="IWebHostBuilder"/>.</param> 251/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 252public static IWebHostBuilder UseStaticWebAssets(this IWebHostBuilder builder)
Microsoft.AspNetCore.Hosting.Abstractions (62)
HostingAbstractionsWebHostBuilderExtensions.cs (50)
14/// Contains extension methods for configuring the <see cref="IWebHostBuilder" />. 21/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 23/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 24public static IWebHostBuilder UseConfiguration(this IWebHostBuilder hostBuilder, IConfiguration configuration) 38/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 40/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 41public static IWebHostBuilder CaptureStartupErrors(this IWebHostBuilder hostBuilder, bool captureStartupErrors) 49/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 51/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 53public static IWebHostBuilder UseStartup(this IWebHostBuilder hostBuilder, string startupAssemblyName) 65/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 67/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 68public static IWebHostBuilder UseServer(this IWebHostBuilder hostBuilder, IServer server) 83/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 85/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 86public static IWebHostBuilder UseEnvironment(this IWebHostBuilder hostBuilder, string environment) 96/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 98/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 99public static IWebHostBuilder UseContentRoot(this IWebHostBuilder hostBuilder, string contentRoot) 109/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 111/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 112public static IWebHostBuilder UseWebRoot(this IWebHostBuilder hostBuilder, string webRoot) 122/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 124/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 125public static IWebHostBuilder UseUrls(this IWebHostBuilder hostBuilder, [StringSyntax(StringSyntaxAttribute.Uri)] params string[] urls) 133/// Indicate whether the host should listen on the URLs configured on the <see cref="IWebHostBuilder"/> 136/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 137/// <param name="preferHostingUrls"><c>true</c> to prefer URLs configured on the <see cref="IWebHostBuilder"/>; otherwise <c>false</c>.</param> 138/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 139public static IWebHostBuilder PreferHostingUrls(this IWebHostBuilder hostBuilder, bool preferHostingUrls) 147/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 149/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 150public static IWebHostBuilder SuppressStatusMessages(this IWebHostBuilder hostBuilder, bool suppressStatusMessages) 158/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 160/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 161public static IWebHostBuilder UseShutdownTimeout(this IWebHostBuilder hostBuilder, TimeSpan timeout) 169/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to start.</param> 171/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 172public static IWebHost Start(this IWebHostBuilder hostBuilder, [StringSyntax(StringSyntaxAttribute.Uri)] params string[] urls)
IHostingStartup.cs (3)
7/// Represents platform specific configuration that will be applied to a <see cref="IWebHostBuilder"/> when building an <see cref="IWebHost"/>. 12/// Configure the <see cref="IWebHostBuilder"/>. 18void Configure(IWebHostBuilder builder);
IWebHostBuilder.cs (9)
24/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 27/// The <see cref="IConfigurationBuilder"/> is pre-populated with the settings of the <see cref="IWebHostBuilder"/>. 29IWebHostBuilder ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate); 36/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 37IWebHostBuilder ConfigureServices(Action<IServiceCollection> configureServices); 44/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 45IWebHostBuilder ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices); 59/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 60IWebHostBuilder UseSetting(string key, string? value);
Microsoft.AspNetCore.Hosting.Tests (103)
Fakes\GenericWebHostBuilderWrapper.cs (9)
30public IWebHostBuilder Configure(Action<IApplicationBuilder> configure) 36public IWebHostBuilder Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure) 42public IWebHostBuilder ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate) 48public IWebHostBuilder ConfigureServices(Action<IServiceCollection> configureServices) 54public IWebHostBuilder ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices) 65public IWebHostBuilder UseDefaultServiceProvider(Action<WebHostBuilderContext, ServiceProviderOptions> configure) 71public IWebHostBuilder UseSetting(string key, string value) 77public IWebHostBuilder UseStartup(Type startupType) 83public IWebHostBuilder UseStartup<TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
WebHostBuilderTests.cs (88)
27public void Build_honors_UseStartup_with_string(IWebHostBuilder builder) 41public async Task StartupMissing_Fallback(IWebHostBuilder builder) 53public async Task StartupStaticCtorThrows_Fallback(IWebHostBuilder builder) 66public void UseStartupThrowsWhenFactoryIsNull(IWebHostBuilder builder) 74public void UseStartupThrowsWhenFactoryReturnsNull(IWebHostBuilder builder) 83public async Task MultipleUseStartupCallsLastWins(IWebHostBuilder builder) 110public async Task UseStartupFactoryWorks(IWebHostBuilder builder) 131public async Task StartupCtorThrows_Fallback(IWebHostBuilder builder) 144public async Task StartupCtorThrows_TypeLoadException(IWebHostBuilder builder) 157public async Task IHostApplicationLifetimeRegisteredEvenWhenStartupCtorThrows_Fallback(IWebHostBuilder builder) 174public async Task StartupConfigureServicesThrows_Fallback(IWebHostBuilder builder) 187public async Task StartupConfigureThrows_Fallback(IWebHostBuilder builder) 200public void DefaultCreatesLoggerFactory(IWebHostBuilder builder) 202var hostBuilder = builder 214public void ConfigureDefaultServiceProvider(IWebHostBuilder builder) 216var hostBuilder = builder 238public void ConfigureDefaultServiceProviderWithContext(IWebHostBuilder builder) 241var hostBuilder = builder 267public void MultipleConfigureLoggingInvokedInOrder(IWebHostBuilder builder) 270var hostBuilder = builder 290public async Task MultipleStartupAssembliesSpecifiedOnlyAddAssemblyOnce(IWebHostBuilder builder) 322var hostBuilder = CreateWebHostBuilder() 342var hostBuilder = CreateWebHostBuilder() 361public void ThereIsAlwaysConfiguration(IWebHostBuilder builder) 363var hostBuilder = builder 375public void ConfigureConfigurationSettingsPropagated(IWebHostBuilder builder) 377var hostBuilder = builder 392public void CanConfigureConfigurationAndRetrieveFromDI(IWebHostBuilder builder) 394var hostBuilder = builder 418public void DoNotCaptureStartupErrorsByDefault(IWebHostBuilder builder) 420var hostBuilder = builder 432var hostBuilder = new WebHostBuilder() 447public void CaptureStartupErrorsHonored(IWebHostBuilder builder) 449var hostBuilder = builder 460public void ConfigureServices_CanBeCalledMultipleTimes(IWebHostBuilder builder) 463var hostBuilder = builder 488public void CodeBasedSettingsCodeBasedOverride(IWebHostBuilder builder) 490var hostBuilder = builder 505public void CodeBasedSettingsConfigBasedOverride(IWebHostBuilder builder) 516var hostBuilder = builder 531public void ConfigBasedSettingsCodeBasedOverride(IWebHostBuilder builder) 542var hostBuilder = builder 557public void ConfigBasedSettingsConfigBasedOverride(IWebHostBuilder builder) 577var hostBuilder = builder 592public void UseEnvironmentIsNotOverriden(IWebHostBuilder builder) 621public void BuildAndDispose(IWebHostBuilder builder) 642public void UseBasePathConfiguresBasePath(IWebHostBuilder builder) 670public void RelativeContentRootIsResolved(IWebHostBuilder builder) 693public void DefaultContentRootIsApplicationBasePath(IWebHostBuilder builder) 710public void DefaultWebHostBuilderWithNoStartupThrows(IWebHostBuilder builder) 725public void DefaultApplicationNameWithUseStartupOfString(IWebHostBuilder builder) 743public void DefaultApplicationNameWithUseStartupOfT(IWebHostBuilder builder) 761public void DefaultApplicationNameWithUseStartupOfType(IWebHostBuilder builder) 774public void DefaultApplicationNameWithConfigure(IWebHostBuilder builder) 790public void DefaultApplicationNameWithUseStartupFactory(IWebHostBuilder builder) 806public void Configure_SupportsNonStaticMethodDelegate(IWebHostBuilder builder) 820public void Configure_SupportsStaticMethodDelegate(IWebHostBuilder builder) 835var builder = CreateWebHostBuilder(); 856var builder = CreateWebHostBuilder(); 869public void Build_DoesNotOverrideILoggerFactorySetByConfigureServices(IWebHostBuilder builder) 886public void Build_RunsHostingStartupAssembliesIfSpecified(IWebHostBuilder builder) 903public void Build_RunsDeduplicatedHostingStartupAssembliesIfSpecified(IWebHostBuilder builder) 923public void Build_RunsHostingStartupRunsPrimaryAssemblyFirst(IWebHostBuilder builder) 941public void Build_RunsHostingStartupAssembliesBeforeApplication(IWebHostBuilder builder) 1002var builder = new GenericWebHostBuilderWrapper(new HostBuilder()) 1043public void Build_HostingStartupAssemblyCanBeExcluded(IWebHostBuilder builder) 1061public void Build_ConfigureLoggingInHostingStartupWorks(IWebHostBuilder builder) 1083public void Build_ConfigureAppConfigurationInHostingStartupWorks(IWebHostBuilder builder) 1099public void Build_AppConfigAvailableEverywhere(IWebHostBuilder builder) 1148public void Build_DoesRunHostingStartupFromPrimaryAssemblyEvenIfNotSpecified(IWebHostBuilder builder) 1162public void Build_HostingStartupFromPrimaryAssemblyCanBeDisabled(IWebHostBuilder builder) 1177public void Build_DoesntThrowIfUnloadableAssemblyNameInHostingStartupAssemblies(IWebHostBuilder builder) 1193public async Task Build_DoesNotThrowIfUnloadableAssemblyNameInHostingStartupAssembliesAndCaptureStartupErrorsTrue(IWebHostBuilder builder) 1216public void StartupErrorsAreLoggedIfCaptureStartupErrorsIsTrue(IWebHostBuilder builder) 1236public void StartupErrorsAreLoggedIfCaptureStartupErrorsIsFalse(IWebHostBuilder builder) 1271public void UseShutdownTimeoutConfiguresShutdownTimeout(IWebHostBuilder builder) 1288public async Task StartupFiltersDoNotRunIfNotApplicationConfigured(IWebHostBuilder builder) 1290var hostBuilder = builder 1318public void UseConfigurationWithSectionAddsSubKeys(IWebHostBuilder builder) 1343public async Task ThrowingFromHostedServiceFailsStartAsync(IWebHostBuilder builder) 1367public async Task ThrowingFromHostedServiceStopsOtherHostedServicesFromRunningStartAsync(IWebHostBuilder builder) 1396public async Task HostedServicesStartedBeforeServer(IWebHostBuilder builder) 1475private IWebHostBuilder CreateWebHostBuilder() 1489public static TheoryData<IWebHostBuilder> DefaultWebHostBuilders => new TheoryData<IWebHostBuilder> 1495public static TheoryData<IWebHostBuilder> DefaultWebHostBuildersWithConfig 1509return new TheoryData<IWebHostBuilder> { 1674public void Configure(IWebHostBuilder builder)
WebHostTests.cs (6)
726var builder = CreateBuilder() 986var builder = CreateBuilder() 1090var builder = CreateBuilder() 1104private IWebHostBuilder CreateBuilder(IConfiguration config = null) 1455public static IWebHostBuilder UseFakeServer(this IWebHostBuilder builder)
Microsoft.AspNetCore.Hosting.TestSites (1)
Program.cs (1)
25var builder = new WebHostBuilder()
Microsoft.AspNetCore.Identity.FunctionalTests (3)
Infrastructure\ServerFactory.cs (3)
39protected override void ConfigureWebHost(IWebHostBuilder builder) 56private void UpdateApplicationParts(IWebHostBuilder builder) => 66protected override TestServer CreateServer(IWebHostBuilder builder)
Microsoft.AspNetCore.Mvc.FunctionalTests (49)
ApiBehaviorTest.cs (2)
36private static void ConfigureWebHostBuilder(IWebHostBuilder builder) => 422private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
AsyncDisposalTest.cs (1)
32private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
AuthMiddlewareAndFilterTestBase.cs (1)
30private static void ConfigureWebHostBuilder(IWebHostBuilder builder) => builder.UseStartup<TStartup>();
AuthMiddlewareUsingRequireAuthTest.cs (1)
29private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
ConsumesAttributeTestsBase.cs (1)
34private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
ControllerEndpointFiltersTest.cs (1)
32private static void ConfigureWebHostBuilder(IWebHostBuilder builder) => builder.UseStartup<StartupForEndpointFilters>();
CorsTestsBase.cs (1)
30private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
GlobalAuthorizationFilterEndpointRoutingTest.cs (1)
11public override void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
GlobalAuthorizationFilterTestBase.cs (1)
32public virtual void ConfigureWebHostBuilder(IWebHostBuilder builder) { }
GlobalAuthorizationFilterUseMvcTest.cs (1)
11public override void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
HtmlGenerationTest.cs (1)
43private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
Infrastructure\MvcEncodedTestFixtureOfT.cs (1)
18protected override void ConfigureWebHost(IWebHostBuilder builder)
Infrastructure\MvcTestFixture.cs (2)
25protected override void ConfigureWebHost(IWebHostBuilder builder) 45protected override TestServer CreateServer(IWebHostBuilder builder)
Infrastructure\MvcWebApplicationBuilderExtensions.cs (3)
20/// <returns>An instance of this <see cref="IWebHostBuilder"/></returns> 21public static IWebHostBuilder UseRequestCulture<TStartup>(this IWebHostBuilder builder, string culture, string uiCulture)
JsonInputFormatterTestBase.cs (1)
20private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
JsonOutputFormatterTestBase.cs (1)
21private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
LinkGeneratorTest.cs (1)
17private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
LinkParserTest.cs (1)
18private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
PageAsyncDisposalTest.cs (1)
18private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
RazorPageModelTest.cs (1)
16private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
RazorPagesNamespaceTest.cs (1)
15private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
RazorPagesTest.cs (1)
23private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
RazorPagesViewSearchTest.cs (1)
15private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
ReadFromDisconnectedClientTest.cs (1)
19private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
RequestFormLimitsTest.cs (1)
16private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
RequestServicesTestBase.cs (1)
19private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
RequestSizeLimitTest.cs (1)
17private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
RespectBrowserAcceptHeaderTests.cs (1)
20private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
RoutingAcrossPipelineBranchesTest.cs (1)
18private static void ConfigureWebHostBuilder(IWebHostBuilder builder) => builder.UseStartup<RoutingWebSite.StartupRoutingDifferentBranches>();
RoutingDynamicOrderTest.cs (1)
18private static void ConfigureWebHostBuilder(IWebHostBuilder builder) => builder.UseStartup<RoutingWebSite.StartupForDynamicOrder>();
RoutingDynamicTest.cs (1)
17private static void ConfigureWebHostBuilder(IWebHostBuilder builder) => builder.UseStartup<RoutingWebSite.StartupForDynamic>();
RoutingFallbackTest.cs (1)
18private static void ConfigureWebHostBuilder(IWebHostBuilder builder) => builder.UseStartup<RoutingWebSite.StartupForFallback>();
RoutingGroupsTest.cs (1)
19private static void ConfigureWebHostBuilder(IWebHostBuilder builder) => builder.UseStartup<StartupForGroups>();
RoutingGroupsWithMetadataTest.cs (1)
18private static void ConfigureWebHostBuilder(IWebHostBuilder builder) => builder.UseStartup<StartupForRouteGroupsWithMetadata>();
RoutingTestsBase.cs (1)
17private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
RoutingWithoutRazorPagesTestsBase.cs (1)
17private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
TempDataInCookiesTest.cs (1)
22protected override void ConfigureWebHostBuilder(IWebHostBuilder builder)
TempDataInCookiesUsingCookieConsentTest.cs (1)
33private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
TempDataTestBase.cs (1)
33protected virtual void ConfigureWebHostBuilder(IWebHostBuilder builder) { }
TestingInfrastructureInheritanceTests.cs (4)
111private static void ConfigureWebHostBuilder(IWebHostBuilder builder) => 138protected override void ConfigureWebHost(IWebHostBuilder builder) 144protected override TestServer CreateServer(IWebHostBuilder builder) 156protected override IWebHostBuilder CreateWebHostBuilder()
TestingInfrastructureTests.cs (1)
27private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
VersioningTestsBase.cs (1)
17private static void ConfigureWebHostBuilder(IWebHostBuilder builder) =>
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
RazorRuntimeCompilationHostingStartup.cs (1)
11public void Configure(IWebHostBuilder builder)
Microsoft.AspNetCore.Mvc.Testing (30)
WebApplicationFactory.cs (30)
31private Action<IWebHostBuilder> _configuration; 97/// by further customizing the <see cref="IWebHostBuilder"/> when calling 98/// <see cref="WebApplicationFactory{TEntryPoint}.WithWebHostBuilder(Action{IWebHostBuilder})"/>. 108/// Creates a new <see cref="WebApplicationFactory{TEntryPoint}"/> with a <see cref="IWebHostBuilder"/> 112/// An <see cref="Action{IWebHostBuilder}"/> to configure the <see cref="IWebHostBuilder"/>. 115public WebApplicationFactory<TEntryPoint> WithWebHostBuilder(Action<IWebHostBuilder> configuration) => 118internal virtual WebApplicationFactory<TEntryPoint> WithWebHostBuilderCore(Action<IWebHostBuilder> configuration) 156var builder = CreateWebHostBuilder(); 190nameof(IWebHostBuilder), 217private void SetContentRoot(IWebHostBuilder builder) 283private static bool SetContentRootFromSetting(IWebHostBuilder builder) 401/// Creates a <see cref="IWebHostBuilder"/> used to set up <see cref="TestServer"/>. 408/// <returns>A <see cref="IWebHostBuilder"/> instance.</returns> 409protected virtual IWebHostBuilder? CreateWebHostBuilder() 411var builder = WebHostBuilderFactory.CreateFromTypesAssemblyEntryPoint<TEntryPoint>(Array.Empty<string>()); 423/// This is only called for applications using <see cref="IWebHostBuilder"/>. Applications based on 426/// <param name="builder">The <see cref="IWebHostBuilder"/> used to 429protected virtual TestServer CreateServer(IWebHostBuilder builder) => new(builder); 434/// <see cref="IWebHostBuilder"/> will use <see cref="CreateServer"/> instead. 448/// <param name="builder">The <see cref="IWebHostBuilder"/> for the application.</param> 449protected virtual void ConfigureWebHost(IWebHostBuilder builder) 609private readonly Func<IWebHostBuilder, TestServer> _createServer; 611private readonly Func<IWebHostBuilder?> _createWebHostBuilder; 618Func<IWebHostBuilder, TestServer> createServer, 620Func<IWebHostBuilder?> createWebHostBuilder, 624Action<IWebHostBuilder> configureWebHost) 636protected override TestServer CreateServer(IWebHostBuilder builder) => _createServer(builder); 640protected override IWebHostBuilder? CreateWebHostBuilder() => _createWebHostBuilder(); 646protected override void ConfigureWebHost(IWebHostBuilder builder) => _configuration(builder); 650internal override WebApplicationFactory<TEntryPoint> WithWebHostBuilderCore(Action<IWebHostBuilder> configuration)
Microsoft.AspNetCore.Server.HttpSys (6)
WebHostBuilderHttpSysExtensions.cs (6)
24/// A reference to the <see cref="IWebHostBuilder" /> parameter object. 27public static IWebHostBuilder UseHttpSys(this IWebHostBuilder hostBuilder) 61/// A reference to the <see cref="IWebHostBuilder" /> parameter object. 64public static IWebHostBuilder UseHttpSys(this IWebHostBuilder hostBuilder, Action<HttpSysOptions> options)
Microsoft.AspNetCore.Server.IIS (4)
WebHostBuilderIISExtensions.cs (4)
21/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 22/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 23public static IWebHostBuilder UseIIS(this IWebHostBuilder hostBuilder)
Microsoft.AspNetCore.Server.IISIntegration (4)
IISHostingStartup.cs (2)
21/// <param name="builder">The <see cref="IWebHostBuilder"/>.</param> 22public void Configure(IWebHostBuilder builder)
WebHostBuilderIISExtensions.cs (2)
31public static IWebHostBuilder UseIISIntegration(this IWebHostBuilder hostBuilder)
Microsoft.AspNetCore.Server.Kestrel (20)
WebHostBuilderKestrelExtensions.cs (20)
18/// Kestrel <see cref="IWebHostBuilder"/> extensions. 23/// In <see cref="UseKestrelCore(IWebHostBuilder)"/> scenarios, it may be necessary to explicitly 28/// Has no effect in <see cref="UseKestrel(IWebHostBuilder)"/> scenarios. 36public static IWebHostBuilder UseKestrelHttpsConfiguration(this IWebHostBuilder hostBuilder) 53public static IWebHostBuilder UseKestrel(this IWebHostBuilder hostBuilder) 69/// Includes less automatic functionality than <see cref="UseKestrel(IWebHostBuilder)"/> to make trimming more effective 80public static IWebHostBuilder UseKestrelCore(this IWebHostBuilder hostBuilder) 113public static IWebHostBuilder UseKestrel(this IWebHostBuilder hostBuilder, Action<KestrelServerOptions> options) 119/// Configures Kestrel options but does not register an IServer. See <see cref="UseKestrel(IWebHostBuilder)"/>. 130public static IWebHostBuilder ConfigureKestrel(this IWebHostBuilder hostBuilder, Action<KestrelServerOptions> options) 149public static IWebHostBuilder UseKestrel(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, KestrelServerOptions> configureOptions) 155/// Configures Kestrel options but does not register an IServer. See <see cref="UseKestrel(IWebHostBuilder)"/>. 164public static IWebHostBuilder ConfigureKestrel(this IWebHostBuilder hostBuilder, Action<WebHostBuilderContext, KestrelServerOptions> configureOptions)
Microsoft.AspNetCore.Server.Kestrel.Tests (13)
HttpsConfigurationTests.cs (7)
24var hostBuilder = new WebHostBuilder() 62var hostBuilder = new WebHostBuilder() 83var hostBuilder = new WebHostBuilder() 121var hostBuilder = new WebHostBuilder() 153var hostBuilder = new WebHostBuilder() 189var hostBuilder = new WebHostBuilder() 214var hostBuilder = new WebHostBuilder()
WebHostBuilderKestrelExtensionsTests.cs (6)
22var hostBuilder = new WebHostBuilder() 43var hostBuilder = new WebHostBuilder() 58var hostBuilder = new WebHostBuilder() 80var hostBuilder = new WebHostBuilder() 88var hostBuilderReversed = new WebHostBuilder() 105var hostBuilder = new WebHostBuilder()
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (9)
WebHostBuilderNamedPipeExtensions.cs (9)
15/// <see cref="IWebHostBuilder" /> extension methods to configure the Named Pipes transport to be used by Kestrel. 22/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 23/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 25public static IWebHostBuilder UseNamedPipes(this IWebHostBuilder hostBuilder) 43/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 45/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 47public static IWebHostBuilder UseNamedPipes(this IWebHostBuilder hostBuilder, Action<NamedPipeTransportOptions> configureOptions)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (9)
WebHostBuilderQuicExtensions.cs (9)
12/// <see cref="IWebHostBuilder" /> extension methods to configure the Quic transport to be used by Kestrel. 19/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 20/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 21public static IWebHostBuilder UseQuic(this IWebHostBuilder hostBuilder) 37/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to configure.</param> 39/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 40public static IWebHostBuilder UseQuic(this IWebHostBuilder hostBuilder, Action<QuicTransportOptions> configureOptions)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (5)
WebHostBuilderSocketExtensions.cs (5)
11/// <see cref="IWebHostBuilder" /> extension methods to configure the Socket transport to be used by Kestrel. 24public static IWebHostBuilder UseSockets(this IWebHostBuilder hostBuilder) 44public static IWebHostBuilder UseSockets(this IWebHostBuilder hostBuilder, Action<SocketTransportOptions> configureOptions)
Microsoft.AspNetCore.SignalR.Client.Tests (2)
TestServerTests.cs (2)
22var builder = new WebHostBuilder().ConfigureServices(s => 74var builder = new WebHostBuilder().ConfigureServices(s =>
Microsoft.AspNetCore.SpaProxy (1)
SpaHostingStartup.cs (1)
16public void Configure(IWebHostBuilder builder)
Microsoft.AspNetCore.TestHost (39)
TestServer.cs (2)
81public TestServer(IWebHostBuilder builder) 91public TestServer(IWebHostBuilder builder, IFeatureCollection featureCollection)
WebHostBuilderExtensions.cs (26)
15/// Contains extensions for configuring the <see cref="IWebHostBuilder" /> instance. 22/// <param name="builder">The <see cref="IWebHostBuilder"/>.</param> 23/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 24public static IWebHostBuilder UseTestServer(this IWebHostBuilder builder) 36/// <param name="builder">The <see cref="IWebHostBuilder"/>.</param> 38/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 39public static IWebHostBuilder UseTestServer(this IWebHostBuilder builder, Action<TestServerOptions> configureOptions) 70/// Configures the <see cref="IWebHostBuilder" /> instance with the services provided in <paramref name="servicesConfiguration" />. 72/// <param name="webHostBuilder">The <see cref="IWebHostBuilder"/>.</param> 74/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 75public static IWebHostBuilder ConfigureTestServices(this IWebHostBuilder webHostBuilder, Action<IServiceCollection> servicesConfiguration) 98/// Configures the <see cref="IWebHostBuilder" /> instance with the services provided in <paramref name="servicesConfiguration" />. 100/// <param name="webHostBuilder">The <see cref="IWebHostBuilder"/>.</param> 104public static IWebHostBuilder ConfigureTestContainer<TContainer>(this IWebHostBuilder webHostBuilder, Action<TContainer> servicesConfiguration) 121/// <param name="builder">The <see cref="IWebHostBuilder"/>.</param> 124/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 126public static IWebHostBuilder UseSolutionRelativeContentRoot( 127this IWebHostBuilder builder, 137/// <param name="builder">The <see cref="IWebHostBuilder"/>.</param> 141/// <returns>The <see cref="IWebHostBuilder"/>.</returns> 143public static IWebHostBuilder UseSolutionRelativeContentRoot( 144this IWebHostBuilder builder,
WebHostBuilderFactory.cs (11)
11/// A factory for creating <see cref="IWebHostBuilder" /> instances. 16/// Resolves an <see cref="IWebHostBuilder" /> defined in the entry point of an assembly. 18/// <param name="assembly">The assembly to look for an <see cref="IWebHostBuilder"/> in.</param> 19/// <param name="args">The arguments to use when creating the <see cref="IWebHostBuilder"/> instance.</param> 20/// <returns>An <see cref="IWebHostBuilder"/> instance retrieved from the assembly in <paramref name="assembly"/>.</returns> 21public static IWebHostBuilder? CreateFromAssemblyEntryPoint(Assembly assembly, string[] args) 23var factory = HostFactoryResolver.ResolveWebHostBuilderFactory<IWebHostBuilder>(assembly); 28/// Resolves an <see cref="IWebHostBuilder" /> defined in an assembly where <typeparamref name="T"/> is declared. 30/// <param name="args">The arguments to use when creating the <see cref="IWebHostBuilder"/> instance.</param> 32/// <returns>An <see cref="IWebHostBuilder"/> instance retrieved from the assembly.</returns> 33public static IWebHostBuilder? CreateFromTypesAssemblyEntryPoint<T>(string[] args) =>
Microsoft.AspNetCore.TestHost.Tests (71)
ClientHandlerTests.cs (1)
694var builder = new WebHostBuilder()
HttpContextBuilderTests.cs (15)
20var builder = new WebHostBuilder().Configure(app => { }); 51var builder = new WebHostBuilder().Configure(app => { }); 66var builder = new WebHostBuilder().Configure(app => { }); 80var builder = new WebHostBuilder().Configure(app => 98var builder = new WebHostBuilder().Configure(app => 121var builder = new WebHostBuilder().Configure(app => 148var builder = new WebHostBuilder().Configure(app => 172var builder = new WebHostBuilder().Configure(app => 194var builder = new WebHostBuilder().Configure(app => 220var builder = new WebHostBuilder().Configure(app => 243var builder = new WebHostBuilder().Configure(app => 269var builder = new WebHostBuilder().Configure(app => 284var builder = new WebHostBuilder().Configure(app => 309var builder = new WebHostBuilder() 331var builder = new WebHostBuilder()
RequestBuilderTests.cs (3)
13var builder = new WebHostBuilder().Configure(app => { }); 26var builder = new WebHostBuilder().Configure(app => { }); 41var builder = new WebHostBuilder().Configure(app => { });
TestClientTests.cs (24)
29var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 51var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 73var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 93var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 111var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 192var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 249var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 300var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 357var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 419var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 466var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 517var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 601var builder = new WebHostBuilder() 671var builder = new WebHostBuilder() 723var builder = new WebHostBuilder() 766var builder = new WebHostBuilder().Configure(app => 799var builder = new WebHostBuilder().Configure(app => 847var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 863var builder = new WebHostBuilder().Configure(app => app.Run(async ctx => 893var builder = new WebHostBuilder() 918var builder = new WebHostBuilder() 949var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 975var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate)); 1002var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate));
TestServerTests.cs (28)
101var builder = new WebHostBuilder() 112var builder = new WebHostBuilder() 124var builder = new WebHostBuilder() 165var builder = new WebHostBuilder() 180var builder = new WebHostBuilder() 194var builder = new WebHostBuilder().Configure(app => 210var builder = new WebHostBuilder().Configure(app => 253var builder = new WebHostBuilder().UseStartup<CustomContainerStartup>(); 264var builder = new WebHostBuilder() 286var builder = new WebHostBuilder() 303var builder = new WebHostBuilder() 327var builder = new WebHostBuilder() 426var builder = new WebHostBuilder().Configure(app => 447var builder = new WebHostBuilder().Configure(app => 496var builder = new WebHostBuilder().Configure(app => 537var builder = new WebHostBuilder().Configure(app => 558var builder = new WebHostBuilder().Configure(app => 575var builder = new WebHostBuilder().Configure(app => 606var builder = new WebHostBuilder().Configure(app => 628var builder = new WebHostBuilder().Configure(app => 644var builder = new WebHostBuilder().Configure(app => 662var builder = new WebHostBuilder().Configure(app => 681var builder = new WebHostBuilder() 699var builder = new WebHostBuilder() 710var builder = new WebHostBuilder() 725var builder = new WebHostBuilder() 753var builder = new WebHostBuilder().Configure(app => 786var builder = new WebHostBuilder().Configure(app => app.Run(appDelegate));
Microsoft.AspNetCore.Testing (9)
ServiceFakesWebHostExtensions.cs (9)
21/// <param name="builder">An <see cref="IWebHostBuilder"/> instance.</param> 23public static IWebHostBuilder UseFakeStartup(this IWebHostBuilder builder) 31/// <param name="builder">An <see cref="IWebHostBuilder"/> instance.</param> 34public static IWebHostBuilder ListenHttpOnAnyPort(this IWebHostBuilder builder) 41/// <param name="builder">An <see cref="IWebHostBuilder"/> instance.</param> 46public static IWebHostBuilder ListenHttpsOnAnyPort(this IWebHostBuilder builder, X509Certificate2? sslCertificate = null)
Microsoft.AspNetCore.Tests (4)
WebApplicationTests.cs (3)
380Assert.Throws<NotSupportedException>(() => ((IWebHostBuilder)createBuilder().WebHost).Build()); 1355var host = builder.WebHost 2920public void Configure(IWebHostBuilder builder)
WebHostTests.cs (1)
25var builder = WebHost.CreateDefaultBuilder(new string[] { "--urls", "http://localhost:5001" });
Mvc.RoutingWebSite (1)
Program.cs (1)
16public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
MvcSandbox (1)
Startup.cs (1)
51public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
PathSchemeSelection (1)
Program.cs (1)
23public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
RazorBuildWebSite (2)
Startup.cs (1)
28public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
StartupWithHostingStartup.cs (1)
43public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
RazorPagesWebSite (1)
Program.cs (1)
16public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
RazorWebSite (1)
Program.cs (1)
16public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
SampleStartups (1)
StartupInjection.cs (1)
17public void Configure(IWebHostBuilder builder)
SecurityWebSite (1)
Program.cs (1)
16public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
ServerComparison.TestSites (1)
Program.cs (1)
16var builder = new WebHostBuilder()
SimpleWebSite (1)
Startup.cs (1)
38public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
StaticFilesAuth (1)
Program.cs (1)
23public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
TagHelpersWebSite (1)
Startup.cs (1)
32public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
TestStartupAssembly1 (1)
TestHostingStartup1.cs (1)
13public void Configure(IWebHostBuilder builder)
VersioningWebSite (1)
Program.cs (1)
16public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
XmlFormattersWebSite (1)
Startup.cs (1)
118public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>