1 write to Host
Microsoft.AspNetCore (1)
WebApplicationBuilder.cs (1)
215
Host
= new ConfigureHostBuilder(bootstrapHostBuilder.Context, Configuration, Services);
28 references to Host
Microsoft.AspNetCore (2)
WebApplicationBuilder.cs (2)
203
[MemberNotNull(nameof(Environment), nameof(
Host
), nameof(WebHost))]
383
Host
.ApplyServiceProviderFactory(_hostApplicationBuilder);
Microsoft.AspNetCore.Tests (26)
WebApplicationTests.cs (26)
373
Assert.Throws<NotSupportedException>(() => ((IHostBuilder)createBuilder().
Host
).Build());
476
builder.
Host
.UseContentRoot(contentRoot + Path.DirectorySeparatorChar);
477
builder.
Host
.UseContentRoot(contentRoot.ToUpperInvariant());
478
builder.
Host
.UseContentRoot(contentRoot.ToLowerInvariant());
621
builder.
Host
.UseContentRoot(AppContext.BaseDirectory);
622
builder.
Host
.UseContentRoot(Path.TrimEndingDirectorySeparator(AppContext.BaseDirectory));
623
builder.
Host
.UseContentRoot("");
941
builder.
Host
.ConfigureAppConfiguration((context, config) =>
983
builder.
Host
.ConfigureAppConfiguration((context, config) =>
1056
builder.
Host
.ConfigureAppConfiguration((context, config) =>
1082
Assert.Throws<NotSupportedException>(() => builder.
Host
.ConfigureHostConfiguration(builder =>
1090
Assert.Throws<NotSupportedException>(() => builder.
Host
.UseEnvironment(envName));
1091
Assert.Throws<NotSupportedException>(() => builder.
Host
.UseContentRoot(contentRoot));
1346
builder.
Host
.Properties["lowercase"] = nameof(WebApplicationTests);
1348
Assert.Equal(nameof(WebApplicationTests), builder.
Host
.Properties["lowercase"]);
1349
Assert.False(builder.
Host
.Properties.ContainsKey("Lowercase"));
1845
var ex5 = Assert.Throws<NotSupportedException>(() => builder.
Host
.ConfigureWebHost(webHostBuilder => { }));
1846
var ex6 = Assert.Throws<NotSupportedException>(() => builder.
Host
.ConfigureWebHost(webHostBuilder => { }, options => { }));
1847
var ex7 = Assert.Throws<NotSupportedException>(() => builder.
Host
.ConfigureSlimWebHost(webHostBuilder => { }, options => { }));
1848
var ex8 = Assert.Throws<NotSupportedException>(() => builder.
Host
.ConfigureWebHostDefaults(webHostBuilder => { }));
2185
builder.
Host
.Properties["hello"] = "world";
2188
builder.
Host
.ConfigureAppConfiguration((context, config) =>
2194
builder.
Host
.ConfigureServices((context, config) =>
2200
builder.
Host
.ConfigureContainer<IServiceCollection>((context, config) =>
2521
builder.
Host
.Properties["MyProp"] = 1;
2524
Assert.Same(builder.
Host
.Properties, iHostApplicationBuilder.Properties);