5 implementations of IWebHostBuilder
Microsoft.AspNetCore (1)
ConfigureWebHostBuilder.cs (1)
16
public sealed class ConfigureWebHostBuilder :
IWebHostBuilder
, ISupportsStartup
Microsoft.AspNetCore.Hosting (3)
GenericHost\HostingStartupWebHostBuilder.cs (1)
15
internal sealed class HostingStartupWebHostBuilder :
IWebHostBuilder
, ISupportsStartup, ISupportsUseDefaultServiceProvider
GenericHost\WebHostBuilderBase.cs (1)
10
internal abstract class WebHostBuilderBase :
IWebHostBuilder
, ISupportsUseDefaultServiceProvider
WebHostBuilder.cs (1)
24
public class WebHostBuilder :
IWebHostBuilder
Microsoft.AspNetCore.Hosting.Tests (1)
Fakes\GenericWebHostBuilderWrapper.cs (1)
12
public class GenericWebHostBuilderWrapper :
IWebHostBuilder
, ISupportsStartup, ISupportsUseDefaultServiceProvider
532 references to IWebHostBuilder
BasicWebSite (1)
Program.cs (1)
19
public static
IWebHostBuilder
CreateWebHostBuilder(string[] args) =>
HttpStress (1)
Program.cs (1)
375
Console.WriteLine(" ASP.NET Core: " + Path.GetFileName(Path.GetDirectoryName(typeof(
IWebHostBuilder
).Assembly.Location)));
Interop.FunctionalTests (2)
Http2WebSocketInteropTests.cs (1)
174
private static void ConfigureKestrel(
IWebHostBuilder
webHostBuilder, string scheme, HttpProtocols protocols)
HttpClientHttp2InteropTests.cs (1)
1706
private static void ConfigureKestrel(
IWebHostBuilder
webHostBuilder, string scheme)
IStartupInjectionAssemblyName (1)
Program.cs (1)
22
private static
IWebHostBuilder
CreateWebHostBuilder(string[] args) =>
Microsoft.AspNetCore (26)
ConfigureHostBuilder.cs (1)
117
IHostBuilder ISupportsConfigureWebHost.ConfigureWebHost(Action<
IWebHostBuilder
> configure, Action<WebHostBuilderOptions> configureOptions)
ConfigureWebHostBuilder.cs (10)
13
/// A non-buildable <see cref="
IWebHostBuilder
"/> for <see cref="WebApplicationBuilder"/>.
32
IWebHost
IWebHostBuilder
.Build()
39
public
IWebHostBuilder
ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate)
90
public
IWebHostBuilder
ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices)
98
public
IWebHostBuilder
ConfigureServices(Action<IServiceCollection> configureServices)
110
public
IWebHostBuilder
UseSetting(string key, string? value)
168
IWebHostBuilder
ISupportsStartup.Configure(Action<IApplicationBuilder> configure)
173
IWebHostBuilder
ISupportsStartup.Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure)
178
IWebHostBuilder
ISupportsStartup.UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType)
183
IWebHostBuilder
ISupportsStartup.UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
GenericHostBuilderExtensions.cs (2)
32
public static IHostBuilder ConfigureWebHostDefaults(this IHostBuilder builder, Action<
IWebHostBuilder
> configure)
58
public static IHostBuilder ConfigureWebHostDefaults(this IHostBuilder builder, Action<
IWebHostBuilder
> configure, Action<WebHostBuilderOptions> configureOptions)
WebApplicationBuilder.cs (2)
221
private void InitializeWebHostSettings(
IWebHostBuilder
webHostBuilder)
357
/// 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.
92
var
builder = CreateDefaultBuilder();
133
/// <returns>The initialized <see cref="
IWebHostBuilder
"/>.</returns>
134
public static
IWebHostBuilder
CreateDefaultBuilder() =>
155
/// <returns>The initialized <see cref="
IWebHostBuilder
"/>.</returns>
156
public static
IWebHostBuilder
CreateDefaultBuilder(string[] args)
220
internal static void ConfigureWebDefaults(
IWebHostBuilder
builder)
242
internal static void ConfigureWebDefaultsSlim(
IWebHostBuilder
builder)
252
private static void ConfigureWebDefaultsWorker(
IWebHostBuilder
builder, Action<IServiceCollection>? configureRouting)
305
/// <returns>The initialized <see cref="
IWebHostBuilder
"/>.</returns>
306
public static
IWebHostBuilder
CreateDefaultBuilder<[DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] TStartup>(string[] args) where TStartup : class =>
Microsoft.AspNetCore.AzureAppServices.HostingStartup (1)
AzureAppServicesHostingStartup.cs (1)
22
public void Configure(
IWebHostBuilder
builder)
Microsoft.AspNetCore.AzureAppServicesIntegration (2)
AppServicesWebHostBuilderExtensions.cs (2)
18
public static
IWebHostBuilder
UseAzureAppServices(this
IWebHostBuilder
hostBuilder)
Microsoft.AspNetCore.AzureAppServicesIntegration.Tests (1)
AppServicesWebHostBuilderExtensionsTest.cs (1)
14
var mock = new Mock<
IWebHostBuilder
>();
Microsoft.AspNetCore.DataProtection.Tests (1)
HostingTests.cs (1)
29
var
builder = new WebHostBuilder()
Microsoft.AspNetCore.Hosting (106)
GenericHost\GenericWebHostBuilder.cs (4)
166
public
IWebHostBuilder
UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType)
191
public
IWebHostBuilder
UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
316
public
IWebHostBuilder
Configure(Action<IApplicationBuilder> configure)
341
public
IWebHostBuilder
Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure)
GenericHost\HostingStartupWebHostBuilder.cs (10)
29
throw new NotSupportedException($"Building this implementation of {nameof(
IWebHostBuilder
)} is not supported.");
33
public
IWebHostBuilder
ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate)
39
public
IWebHostBuilder
ConfigureServices(Action<IServiceCollection> configureServices)
44
public
IWebHostBuilder
ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices)
52
public
IWebHostBuilder
UseSetting(string key, string? value)
68
public
IWebHostBuilder
UseDefaultServiceProvider(Action<WebHostBuilderContext, ServiceProviderOptions> configure)
73
public
IWebHostBuilder
Configure(Action<IApplicationBuilder> configure)
78
public
IWebHostBuilder
Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure)
83
public
IWebHostBuilder
UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType)
90
public
IWebHostBuilder
UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
GenericHost\ISupportsUseDefaultServiceProvider.cs (1)
10
IWebHostBuilder
UseDefaultServiceProvider(Action<WebHostBuilderContext, ServiceProviderOptions> configure);
GenericHost\SlimWebHostBuilder.cs (4)
62
public
IWebHostBuilder
Configure(Action<IApplicationBuilder> configure)
67
public
IWebHostBuilder
UseStartup([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicMethods)] Type startupType)
72
public
IWebHostBuilder
UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
77
public
IWebHostBuilder
Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure)
GenericHost\WebHostBuilderBase.cs (6)
32
throw new NotSupportedException($"Building this implementation of {nameof(
IWebHostBuilder
)} is not supported.");
36
public
IWebHostBuilder
ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate)
47
public
IWebHostBuilder
ConfigureServices(Action<IServiceCollection> configureServices)
52
public
IWebHostBuilder
ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices)
63
public
IWebHostBuilder
UseDefaultServiceProvider(Action<WebHostBuilderContext, ServiceProviderOptions> configure)
104
public
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>
21
public 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>
35
public 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>
51
public static IHostBuilder ConfigureSlimWebHost(this IHostBuilder builder, Action<
IWebHostBuilder
> configure, Action<WebHostBuilderOptions> configureWebHostBuilder)
62
Func<IHostBuilder, WebHostBuilderOptions,
IWebHostBuilder
> createWebHostBuilder,
63
Action<
IWebHostBuilder
> configure,
77
var
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>
20
IHostBuilder 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>
22
IWebHostBuilder
Configure(Action<IApplicationBuilder> configure);
28
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
29
IWebHostBuilder
Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure);
35
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
36
IWebHostBuilder
UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType);
42
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
44
IWebHostBuilder
UseStartup<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory);
WebHostBuilder.cs (9)
80
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
81
public
IWebHostBuilder
UseSetting(string key, string? value)
92
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
93
public
IWebHostBuilder
ConfigureServices(Action<IServiceCollection> configureServices)
105
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
106
public
IWebHostBuilder
ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices)
116
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
119
/// The <see cref="IConfigurationBuilder"/> is pre-populated with the settings of the <see cref="
IWebHostBuilder
"/>.
121
public
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>
31
public 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>
60
public 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>
90
public 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>
133
public 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>
171
public 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>
182
public 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>
193
public 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
"/>.
219
public 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>
230
public 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>
241
public 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>
252
public 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>
24
public 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>
41
public 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>
53
public 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>
68
public 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>
86
public 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>
99
public 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>
112
public 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>
125
public 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>
139
public 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>
150
public 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>
161
public 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>
173
public 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
"/>.
18
void Configure(
IWebHostBuilder
builder);
IWebHostBuilder.cs (9)
25
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
28
/// The <see cref="IConfigurationBuilder"/> is pre-populated with the settings of the <see cref="
IWebHostBuilder
"/>.
30
IWebHostBuilder
ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate);
37
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
38
IWebHostBuilder
ConfigureServices(Action<IServiceCollection> configureServices);
45
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
46
IWebHostBuilder
ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices);
60
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
61
IWebHostBuilder
UseSetting(string key, string? value);
Microsoft.AspNetCore.Hosting.Tests (103)
Fakes\GenericWebHostBuilderWrapper.cs (9)
32
public
IWebHostBuilder
Configure(Action<IApplicationBuilder> configure)
38
public
IWebHostBuilder
Configure(Action<WebHostBuilderContext, IApplicationBuilder> configure)
44
public
IWebHostBuilder
ConfigureAppConfiguration(Action<WebHostBuilderContext, IConfigurationBuilder> configureDelegate)
50
public
IWebHostBuilder
ConfigureServices(Action<IServiceCollection> configureServices)
56
public
IWebHostBuilder
ConfigureServices(Action<WebHostBuilderContext, IServiceCollection> configureServices)
67
public
IWebHostBuilder
UseDefaultServiceProvider(Action<WebHostBuilderContext, ServiceProviderOptions> configure)
73
public
IWebHostBuilder
UseSetting(string key, string value)
79
public
IWebHostBuilder
UseStartup(Type startupType)
85
public
IWebHostBuilder
UseStartup<TStartup>(Func<WebHostBuilderContext, TStartup> startupFactory)
WebHostBuilderTests.cs (88)
29
public void Build_honors_UseStartup_with_string(
IWebHostBuilder
builder)
43
public async Task StartupMissing_Fallback(
IWebHostBuilder
builder)
55
public async Task StartupStaticCtorThrows_Fallback(
IWebHostBuilder
builder)
68
public void UseStartupThrowsWhenFactoryIsNull(
IWebHostBuilder
builder)
76
public void UseStartupThrowsWhenFactoryReturnsNull(
IWebHostBuilder
builder)
85
public async Task MultipleUseStartupCallsLastWins(
IWebHostBuilder
builder)
112
public async Task UseStartupFactoryWorks(
IWebHostBuilder
builder)
133
public async Task StartupCtorThrows_Fallback(
IWebHostBuilder
builder)
146
public async Task StartupCtorThrows_TypeLoadException(
IWebHostBuilder
builder)
159
public async Task IHostApplicationLifetimeRegisteredEvenWhenStartupCtorThrows_Fallback(
IWebHostBuilder
builder)
176
public async Task StartupConfigureServicesThrows_Fallback(
IWebHostBuilder
builder)
189
public async Task StartupConfigureThrows_Fallback(
IWebHostBuilder
builder)
202
public void DefaultCreatesLoggerFactory(
IWebHostBuilder
builder)
204
var
hostBuilder = builder
216
public void ConfigureDefaultServiceProvider(
IWebHostBuilder
builder)
218
var
hostBuilder = builder
240
public void ConfigureDefaultServiceProviderWithContext(
IWebHostBuilder
builder)
243
var
hostBuilder = builder
269
public void MultipleConfigureLoggingInvokedInOrder(
IWebHostBuilder
builder)
272
var
hostBuilder = builder
292
public async Task MultipleStartupAssembliesSpecifiedOnlyAddAssemblyOnce(
IWebHostBuilder
builder)
324
var
hostBuilder = CreateWebHostBuilder()
344
var
hostBuilder = CreateWebHostBuilder()
363
public void ThereIsAlwaysConfiguration(
IWebHostBuilder
builder)
365
var
hostBuilder = builder
377
public void ConfigureConfigurationSettingsPropagated(
IWebHostBuilder
builder)
379
var
hostBuilder = builder
394
public void CanConfigureConfigurationAndRetrieveFromDI(
IWebHostBuilder
builder)
396
var
hostBuilder = builder
420
public void DoNotCaptureStartupErrorsByDefault(
IWebHostBuilder
builder)
422
var
hostBuilder = builder
435
var
hostBuilder = new WebHostBuilder()
451
public void CaptureStartupErrorsHonored(
IWebHostBuilder
builder)
453
var
hostBuilder = builder
464
public void ConfigureServices_CanBeCalledMultipleTimes(
IWebHostBuilder
builder)
467
var
hostBuilder = builder
492
public void CodeBasedSettingsCodeBasedOverride(
IWebHostBuilder
builder)
494
var
hostBuilder = builder
509
public void CodeBasedSettingsConfigBasedOverride(
IWebHostBuilder
builder)
520
var
hostBuilder = builder
535
public void ConfigBasedSettingsCodeBasedOverride(
IWebHostBuilder
builder)
546
var
hostBuilder = builder
561
public void ConfigBasedSettingsConfigBasedOverride(
IWebHostBuilder
builder)
581
var
hostBuilder = builder
596
public void UseEnvironmentIsNotOverriden(
IWebHostBuilder
builder)
625
public void BuildAndDispose(
IWebHostBuilder
builder)
646
public void UseBasePathConfiguresBasePath(
IWebHostBuilder
builder)
674
public void RelativeContentRootIsResolved(
IWebHostBuilder
builder)
697
public void DefaultContentRootIsApplicationBasePath(
IWebHostBuilder
builder)
714
public void DefaultWebHostBuilderWithNoStartupThrows(
IWebHostBuilder
builder)
729
public void DefaultApplicationNameWithUseStartupOfString(
IWebHostBuilder
builder)
747
public void DefaultApplicationNameWithUseStartupOfT(
IWebHostBuilder
builder)
765
public void DefaultApplicationNameWithUseStartupOfType(
IWebHostBuilder
builder)
778
public void DefaultApplicationNameWithConfigure(
IWebHostBuilder
builder)
794
public void DefaultApplicationNameWithUseStartupFactory(
IWebHostBuilder
builder)
810
public void Configure_SupportsNonStaticMethodDelegate(
IWebHostBuilder
builder)
824
public void Configure_SupportsStaticMethodDelegate(
IWebHostBuilder
builder)
839
var
builder = CreateWebHostBuilder();
860
var
builder = CreateWebHostBuilder();
873
public void Build_DoesNotOverrideILoggerFactorySetByConfigureServices(
IWebHostBuilder
builder)
890
public void Build_RunsHostingStartupAssembliesIfSpecified(
IWebHostBuilder
builder)
907
public void Build_RunsDeduplicatedHostingStartupAssembliesIfSpecified(
IWebHostBuilder
builder)
927
public void Build_RunsHostingStartupRunsPrimaryAssemblyFirst(
IWebHostBuilder
builder)
945
public void Build_RunsHostingStartupAssembliesBeforeApplication(
IWebHostBuilder
builder)
1006
var
builder = new GenericWebHostBuilderWrapper(new HostBuilder())
1047
public void Build_HostingStartupAssemblyCanBeExcluded(
IWebHostBuilder
builder)
1065
public void Build_ConfigureLoggingInHostingStartupWorks(
IWebHostBuilder
builder)
1087
public void Build_ConfigureAppConfigurationInHostingStartupWorks(
IWebHostBuilder
builder)
1103
public void Build_AppConfigAvailableEverywhere(
IWebHostBuilder
builder)
1152
public void Build_DoesRunHostingStartupFromPrimaryAssemblyEvenIfNotSpecified(
IWebHostBuilder
builder)
1166
public void Build_HostingStartupFromPrimaryAssemblyCanBeDisabled(
IWebHostBuilder
builder)
1181
public void Build_DoesntThrowIfUnloadableAssemblyNameInHostingStartupAssemblies(
IWebHostBuilder
builder)
1197
public async Task Build_DoesNotThrowIfUnloadableAssemblyNameInHostingStartupAssembliesAndCaptureStartupErrorsTrue(
IWebHostBuilder
builder)
1220
public void StartupErrorsAreLoggedIfCaptureStartupErrorsIsTrue(
IWebHostBuilder
builder)
1240
public void StartupErrorsAreLoggedIfCaptureStartupErrorsIsFalse(
IWebHostBuilder
builder)
1275
public void UseShutdownTimeoutConfiguresShutdownTimeout(
IWebHostBuilder
builder)
1292
public async Task StartupFiltersDoNotRunIfNotApplicationConfigured(
IWebHostBuilder
builder)
1294
var
hostBuilder = builder
1322
public void UseConfigurationWithSectionAddsSubKeys(
IWebHostBuilder
builder)
1347
public async Task ThrowingFromHostedServiceFailsStartAsync(
IWebHostBuilder
builder)
1371
public async Task ThrowingFromHostedServiceStopsOtherHostedServicesFromRunningStartAsync(
IWebHostBuilder
builder)
1400
public async Task HostedServicesStartedBeforeServer(
IWebHostBuilder
builder)
1479
private
IWebHostBuilder
CreateWebHostBuilder()
1496
public static TheoryData<
IWebHostBuilder
> DefaultWebHostBuilders => new TheoryData<
IWebHostBuilder
>
1503
public static TheoryData<
IWebHostBuilder
> DefaultWebHostBuildersWithConfig
1518
return new TheoryData<
IWebHostBuilder
> {
1684
public void Configure(
IWebHostBuilder
builder)
WebHostTests.cs (6)
728
var
builder = CreateBuilder()
988
var
builder = CreateBuilder()
1092
var
builder = CreateBuilder()
1106
private
IWebHostBuilder
CreateBuilder(IConfiguration config = null)
1459
public static
IWebHostBuilder
UseFakeServer(this
IWebHostBuilder
builder)
Microsoft.AspNetCore.Identity.FunctionalTests (3)
Infrastructure\ServerFactory.cs (3)
39
protected override void ConfigureWebHost(
IWebHostBuilder
builder)
56
private void UpdateApplicationParts(
IWebHostBuilder
builder) =>
67
protected override TestServer CreateServer(
IWebHostBuilder
builder)
Microsoft.AspNetCore.Mvc.FunctionalTests (49)
ApiBehaviorTest.cs (2)
36
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
422
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
AsyncDisposalTest.cs (1)
32
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
AuthMiddlewareAndFilterTestBase.cs (1)
30
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) => builder.UseStartup<TStartup>();
AuthMiddlewareUsingRequireAuthTest.cs (1)
29
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
ConsumesAttributeTestsBase.cs (1)
34
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
ControllerEndpointFiltersTest.cs (1)
32
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) => builder.UseStartup<StartupForEndpointFilters>();
CorsTestsBase.cs (1)
30
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
GlobalAuthorizationFilterEndpointRoutingTest.cs (1)
11
public override void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
GlobalAuthorizationFilterTestBase.cs (1)
32
public virtual void ConfigureWebHostBuilder(
IWebHostBuilder
builder) { }
GlobalAuthorizationFilterUseMvcTest.cs (1)
11
public override void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
HtmlGenerationTest.cs (1)
43
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
Infrastructure\MvcEncodedTestFixtureOfT.cs (1)
17
protected override void ConfigureWebHost(
IWebHostBuilder
builder)
Infrastructure\MvcTestFixture.cs (2)
25
protected override void ConfigureWebHost(
IWebHostBuilder
builder)
46
protected override TestServer CreateServer(
IWebHostBuilder
builder)
Infrastructure\MvcWebApplicationBuilderExtensions.cs (3)
20
/// <returns>An instance of this <see cref="
IWebHostBuilder
"/></returns>
21
public static
IWebHostBuilder
UseRequestCulture<TStartup>(this
IWebHostBuilder
builder, string culture, string uiCulture)
JsonInputFormatterTestBase.cs (1)
20
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
JsonOutputFormatterTestBase.cs (1)
21
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
LinkGeneratorTest.cs (1)
17
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
LinkParserTest.cs (1)
18
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
PageAsyncDisposalTest.cs (1)
18
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
RazorPageModelTest.cs (1)
16
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
RazorPagesNamespaceTest.cs (1)
15
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
RazorPagesTest.cs (1)
23
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
RazorPagesViewSearchTest.cs (1)
15
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
ReadFromDisconnectedClientTest.cs (1)
19
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
RequestFormLimitsTest.cs (1)
16
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
RequestServicesTestBase.cs (1)
19
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
RequestSizeLimitTest.cs (1)
17
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
RespectBrowserAcceptHeaderTests.cs (1)
20
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
RoutingAcrossPipelineBranchesTest.cs (1)
18
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) => builder.UseStartup<RoutingWebSite.StartupRoutingDifferentBranches>();
RoutingDynamicOrderTest.cs (1)
18
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) => builder.UseStartup<RoutingWebSite.StartupForDynamicOrder>();
RoutingDynamicTest.cs (1)
17
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) => builder.UseStartup<RoutingWebSite.StartupForDynamic>();
RoutingFallbackTest.cs (1)
18
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) => builder.UseStartup<RoutingWebSite.StartupForFallback>();
RoutingGroupsTest.cs (1)
19
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) => builder.UseStartup<StartupForGroups>();
RoutingGroupsWithMetadataTest.cs (1)
18
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) => builder.UseStartup<StartupForRouteGroupsWithMetadata>();
RoutingTestsBase.cs (1)
17
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
RoutingWithoutRazorPagesTestsBase.cs (1)
17
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
TempDataInCookiesTest.cs (1)
22
protected override void ConfigureWebHostBuilder(
IWebHostBuilder
builder)
TempDataInCookiesUsingCookieConsentTest.cs (1)
33
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
TempDataTestBase.cs (1)
33
protected virtual void ConfigureWebHostBuilder(
IWebHostBuilder
builder) { }
TestingInfrastructureInheritanceTests.cs (4)
130
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
158
protected override void ConfigureWebHost(
IWebHostBuilder
builder)
166
protected override TestServer CreateServer(
IWebHostBuilder
builder)
186
protected override
IWebHostBuilder
CreateWebHostBuilder()
TestingInfrastructureTests.cs (1)
27
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
VersioningTestsBase.cs (1)
17
private static void ConfigureWebHostBuilder(
IWebHostBuilder
builder) =>
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
RazorRuntimeCompilationHostingStartup.cs (1)
11
public void Configure(
IWebHostBuilder
builder)
Microsoft.AspNetCore.Mvc.Testing (34)
WebApplicationFactory.cs (34)
37
private Action<
IWebHostBuilder
> _configuration;
124
/// by further customizing the <see cref="
IWebHostBuilder
"/> when calling
125
/// <see cref="WebApplicationFactory{TEntryPoint}.WithWebHostBuilder(Action{
IWebHostBuilder
})"/>.
135
/// Creates a new <see cref="WebApplicationFactory{TEntryPoint}"/> with a <see cref="
IWebHostBuilder
"/>
139
/// An <see cref="Action{IWebHostBuilder}"/> to configure the <see cref="
IWebHostBuilder
"/>.
142
public WebApplicationFactory<TEntryPoint> WithWebHostBuilder(Action<
IWebHostBuilder
> configuration) =>
145
internal virtual WebApplicationFactory<TEntryPoint> WithWebHostBuilderCore(Action<
IWebHostBuilder
> configuration)
211
private IWebHost CreateKestrelServer(
IWebHostBuilder
builder)
238
private void ConfigureBuilderToUseKestrel(
IWebHostBuilder
builder)
270
var
builder = CreateWebHostBuilder();
304
nameof(
IWebHostBuilder
),
368
private void SetContentRoot(
IWebHostBuilder
builder)
434
private static bool SetContentRootFromSetting(
IWebHostBuilder
builder)
552
/// Creates a <see cref="
IWebHostBuilder
"/> used to set up <see cref="TestServer"/>.
559
/// <returns>A <see cref="
IWebHostBuilder
"/> instance.</returns>
560
protected virtual
IWebHostBuilder
? CreateWebHostBuilder()
562
var
builder = WebHostBuilderFactory.CreateFromTypesAssemblyEntryPoint<TEntryPoint>(Array.Empty<string>());
574
/// This is only called for applications using <see cref="
IWebHostBuilder
"/>. Applications based on
577
/// <param name="builder">The <see cref="
IWebHostBuilder
"/> used to
581
protected virtual TestServer CreateServer(
IWebHostBuilder
builder) => new(builder);
586
/// <see cref="
IWebHostBuilder
"/> will use <see cref="CreateHost"/> instead.
595
/// <see cref="
IWebHostBuilder
"/> will use <see cref="CreateServer(
IWebHostBuilder
)"/> instead.
616
/// <param name="builder">The <see cref="
IWebHostBuilder
"/> for the application.</param>
617
protected virtual void ConfigureWebHost(
IWebHostBuilder
builder)
829
private readonly Func<
IWebHostBuilder
, TestServer> _createServer;
832
private readonly Func<
IWebHostBuilder
?> _createWebHostBuilder;
839
Func<
IWebHostBuilder
, TestServer> createServer,
842
Func<
IWebHostBuilder
?> createWebHostBuilder,
846
Action<
IWebHostBuilder
> configureWebHost)
860
protected override TestServer CreateServer(
IWebHostBuilder
builder) => _createServer(builder);
866
protected override
IWebHostBuilder
? CreateWebHostBuilder() => _createWebHostBuilder();
872
protected override void ConfigureWebHost(
IWebHostBuilder
builder) => _configuration(builder);
876
internal override WebApplicationFactory<TEntryPoint> WithWebHostBuilderCore(Action<
IWebHostBuilder
> configuration)
Microsoft.AspNetCore.OpenApi.Tests (1)
Integration\LocalizedSampleAppFixture.cs (1)
13
protected override void ConfigureWebHost(
IWebHostBuilder
builder)
Microsoft.AspNetCore.Server.HttpSys (6)
WebHostBuilderHttpSysExtensions.cs (6)
26
/// A reference to the <see cref="
IWebHostBuilder
" /> parameter object.
29
public static
IWebHostBuilder
UseHttpSys(this
IWebHostBuilder
hostBuilder)
65
/// A reference to the <see cref="
IWebHostBuilder
" /> parameter object.
68
public static
IWebHostBuilder
UseHttpSys(this
IWebHostBuilder
hostBuilder, Action<HttpSysOptions> options)
Microsoft.AspNetCore.Server.IIS (4)
WebHostBuilderIISExtensions.cs (4)
23
/// <param name="hostBuilder">The <see cref="
IWebHostBuilder
"/> to configure.</param>
24
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
25
public static
IWebHostBuilder
UseIIS(this
IWebHostBuilder
hostBuilder)
Microsoft.AspNetCore.Server.IISIntegration (4)
IISHostingStartup.cs (2)
21
/// <param name="builder">The <see cref="
IWebHostBuilder
"/>.</param>
22
public void Configure(
IWebHostBuilder
builder)
WebHostBuilderIISExtensions.cs (2)
31
public static
IWebHostBuilder
UseIISIntegration(this
IWebHostBuilder
hostBuilder)
Microsoft.AspNetCore.Server.Kestrel (20)
WebHostBuilderKestrelExtensions.cs (20)
17
/// Kestrel <see cref="
IWebHostBuilder
"/> extensions.
22
/// In <see cref="UseKestrelCore(
IWebHostBuilder
)"/> scenarios, it may be necessary to explicitly
27
/// Has no effect in <see cref="UseKestrel(
IWebHostBuilder
)"/> scenarios.
35
public static
IWebHostBuilder
UseKestrelHttpsConfiguration(this
IWebHostBuilder
hostBuilder)
52
public static
IWebHostBuilder
UseKestrel(this
IWebHostBuilder
hostBuilder)
68
/// Includes less automatic functionality than <see cref="UseKestrel(
IWebHostBuilder
)"/> to make trimming more effective
79
public static
IWebHostBuilder
UseKestrelCore(this
IWebHostBuilder
hostBuilder)
115
public static
IWebHostBuilder
UseKestrel(this
IWebHostBuilder
hostBuilder, Action<KestrelServerOptions> options)
121
/// Configures Kestrel options but does not register an IServer. See <see cref="UseKestrel(
IWebHostBuilder
)"/>.
132
public static
IWebHostBuilder
ConfigureKestrel(this
IWebHostBuilder
hostBuilder, Action<KestrelServerOptions> options)
151
public static
IWebHostBuilder
UseKestrel(this
IWebHostBuilder
hostBuilder, Action<WebHostBuilderContext, KestrelServerOptions> configureOptions)
157
/// Configures Kestrel options but does not register an IServer. See <see cref="UseKestrel(
IWebHostBuilder
)"/>.
166
public static
IWebHostBuilder
ConfigureKestrel(this
IWebHostBuilder
hostBuilder, Action<WebHostBuilderContext, KestrelServerOptions> configureOptions)
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>
25
public static
IWebHostBuilder
UseNamedPipes(this
IWebHostBuilder
hostBuilder)
52
/// <param name="hostBuilder">The <see cref="
IWebHostBuilder
"/> to configure.</param>
54
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
56
public 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>
21
public static
IWebHostBuilder
UseQuic(this
IWebHostBuilder
hostBuilder)
37
/// <param name="hostBuilder">The <see cref="
IWebHostBuilder
"/> to configure.</param>
39
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
40
public static
IWebHostBuilder
UseQuic(this
IWebHostBuilder
hostBuilder, Action<QuicTransportOptions> configureOptions)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (5)
WebHostBuilderSocketExtensions.cs (5)
13
/// <see cref="
IWebHostBuilder
" /> extension methods to configure the Socket transport to be used by Kestrel.
26
public static
IWebHostBuilder
UseSockets(this
IWebHostBuilder
hostBuilder)
53
public static
IWebHostBuilder
UseSockets(this
IWebHostBuilder
hostBuilder, Action<SocketTransportOptions> configureOptions)
Microsoft.AspNetCore.SpaProxy (1)
SpaHostingStartup.cs (1)
16
public void Configure(
IWebHostBuilder
builder)
Microsoft.AspNetCore.TestHost (47)
TestServer.cs (2)
84
public TestServer(
IWebHostBuilder
builder)
95
public TestServer(
IWebHostBuilder
builder, IFeatureCollection featureCollection)
WebHostBuilderExtensions.cs (34)
15
/// Contains extensions for configuring the <see cref="
IWebHostBuilder
" /> instance.
24
/// <param name="builder">The <see cref="
IWebHostBuilder
"/>.</param>
25
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
26
public static
IWebHostBuilder
UseTestServer(this
IWebHostBuilder
builder)
38
/// <param name="builder">The <see cref="
IWebHostBuilder
"/>.</param>
40
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
41
public static
IWebHostBuilder
UseTestServer(this
IWebHostBuilder
builder, Action<TestServerOptions> configureOptions)
74
/// Configures the <see cref="
IWebHostBuilder
" /> instance with the services provided in <paramref name="servicesConfiguration" />.
76
/// <param name="webHostBuilder">The <see cref="
IWebHostBuilder
"/>.</param>
78
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
79
public static
IWebHostBuilder
ConfigureTestServices(this
IWebHostBuilder
webHostBuilder, Action<IServiceCollection> servicesConfiguration)
102
/// Configures the <see cref="
IWebHostBuilder
" /> instance with the services provided in <paramref name="servicesConfiguration" />.
104
/// <param name="webHostBuilder">The <see cref="
IWebHostBuilder
"/>.</param>
108
public static
IWebHostBuilder
ConfigureTestContainer<TContainer>(this
IWebHostBuilder
webHostBuilder, Action<TContainer> servicesConfiguration)
125
/// <param name="builder">The <see cref="
IWebHostBuilder
"/>.</param>
127
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
128
public static
IWebHostBuilder
UseSolutionRelativeContentRoot(
129
this
IWebHostBuilder
builder,
138
/// <param name="builder">The <see cref="
IWebHostBuilder
"/>.</param>
141
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
142
public static
IWebHostBuilder
UseSolutionRelativeContentRoot(
143
this
IWebHostBuilder
builder,
153
/// <param name="builder">The <see cref="
IWebHostBuilder
"/>.</param>
157
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
158
public static
IWebHostBuilder
UseSolutionRelativeContentRoot(
159
this
IWebHostBuilder
builder,
170
/// <param name="builder">The <see cref="
IWebHostBuilder
"/>.</param>
174
/// <returns>The <see cref="
IWebHostBuilder
"/>.</returns>
176
public static
IWebHostBuilder
UseSolutionRelativeContentRoot(
177
this
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>
21
public static
IWebHostBuilder
? CreateFromAssemblyEntryPoint(Assembly assembly, string[] args)
23
var 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>
33
public static
IWebHostBuilder
? CreateFromTypesAssemblyEntryPoint<T>(string[] args) =>
Microsoft.AspNetCore.TestHost.Tests (17)
TestServerTests.cs (10)
120
var
builder = new WebHostBuilder()
136
var
builder = new WebHostBuilder()
181
var
builder = new WebHostBuilder()
200
var
builder = new WebHostBuilder()
316
var
builder = new WebHostBuilder().UseStartup<CustomContainerStartup>();
331
var
builder = new WebHostBuilder()
357
var
builder = new WebHostBuilder()
378
var
builder = new WebHostBuilder()
406
var
builder = new WebHostBuilder()
826
var
builder = new WebHostBuilder().Configure(app =>
UseSolutionRelativeContentRootTests.cs (7)
29
var
builder = new WebHostBuilder()
54
var
builder = new WebHostBuilder()
83
var
builder = new WebHostBuilder()
112
var
builder = new WebHostBuilder()
138
var
builder = new WebHostBuilder()
153
var
builder = new WebHostBuilder()
179
var
builder = new WebHostBuilder()
Microsoft.AspNetCore.Testing (9)
ServiceFakesWebHostExtensions.cs (9)
21
/// <param name="builder">An <see cref="
IWebHostBuilder
"/> instance.</param>
23
public static
IWebHostBuilder
UseFakeStartup(this
IWebHostBuilder
builder)
31
/// <param name="builder">An <see cref="
IWebHostBuilder
"/> instance.</param>
34
public static
IWebHostBuilder
ListenHttpOnAnyPort(this
IWebHostBuilder
builder)
41
/// <param name="builder">An <see cref="
IWebHostBuilder
"/> instance.</param>
46
public static
IWebHostBuilder
ListenHttpsOnAnyPort(this
IWebHostBuilder
builder, X509Certificate2? sslCertificate = null)
Microsoft.AspNetCore.Tests (4)
WebApplicationTests.cs (3)
381
Assert.Throws<NotSupportedException>(() => ((
IWebHostBuilder
)createBuilder().WebHost).Build());
1357
var
host = builder.WebHost
2922
public void Configure(
IWebHostBuilder
builder)
WebHostTests.cs (1)
27
var
builder = WebHost.CreateDefaultBuilder(new string[] { "--urls", "http://localhost:5001" });
SampleStartups (1)
StartupInjection.cs (1)
17
public void Configure(
IWebHostBuilder
builder)
TestStartupAssembly1 (1)
TestHostingStartup1.cs (1)
13
public void Configure(
IWebHostBuilder
builder)