1 write to Host
Microsoft.AspNetCore (1)
WebApplicationBuilder.cs (1)
213
Host
= new ConfigureHostBuilder(bootstrapHostBuilder.Context, Configuration, Services);
28 references to Host
Microsoft.AspNetCore (2)
WebApplicationBuilder.cs (2)
201
[MemberNotNull(nameof(Environment), nameof(
Host
), nameof(WebHost))]
381
Host
.ApplyServiceProviderFactory(_hostApplicationBuilder);
Microsoft.AspNetCore.Tests (26)
WebApplicationTests.cs (26)
373
Assert.Throws<NotSupportedException>(() => ((IHostBuilder)createBuilder().
Host
).Build());
474
builder.
Host
.UseContentRoot(contentRoot + Path.DirectorySeparatorChar);
475
builder.
Host
.UseContentRoot(contentRoot.ToUpperInvariant());
476
builder.
Host
.UseContentRoot(contentRoot.ToLowerInvariant());
619
builder.
Host
.UseContentRoot(AppContext.BaseDirectory);
620
builder.
Host
.UseContentRoot(Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory));
621
builder.
Host
.UseContentRoot("");
939
builder.
Host
.ConfigureAppConfiguration((context, config) =>
981
builder.
Host
.ConfigureAppConfiguration((context, config) =>
1054
builder.
Host
.ConfigureAppConfiguration((context, config) =>
1080
Assert.Throws<NotSupportedException>(() => builder.
Host
.ConfigureHostConfiguration(builder =>
1088
Assert.Throws<NotSupportedException>(() => builder.
Host
.UseEnvironment(envName));
1089
Assert.Throws<NotSupportedException>(() => builder.
Host
.UseContentRoot(contentRoot));
1344
builder.
Host
.Properties["lowercase"] = nameof(WebApplicationTests);
1346
Assert.Equal(nameof(WebApplicationTests), builder.
Host
.Properties["lowercase"]);
1347
Assert.False(builder.
Host
.Properties.ContainsKey("Lowercase"));
1843
var ex5 = Assert.Throws<NotSupportedException>(() => builder.
Host
.ConfigureWebHost(webHostBuilder => { }));
1844
var ex6 = Assert.Throws<NotSupportedException>(() => builder.
Host
.ConfigureWebHost(webHostBuilder => { }, options => { }));
1845
var ex7 = Assert.Throws<NotSupportedException>(() => builder.
Host
.ConfigureSlimWebHost(webHostBuilder => { }, options => { }));
1846
var ex8 = Assert.Throws<NotSupportedException>(() => builder.
Host
.ConfigureWebHostDefaults(webHostBuilder => { }));
2183
builder.
Host
.Properties["hello"] = "world";
2186
builder.
Host
.ConfigureAppConfiguration((context, config) =>
2192
builder.
Host
.ConfigureServices((context, config) =>
2198
builder.
Host
.ConfigureContainer<IServiceCollection>((context, config) =>
2519
builder.
Host
.Properties["MyProp"] = 1;
2522
Assert.Same(builder.
Host
.Properties, iHostApplicationBuilder.Properties);