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