2 instantiations of HostBuilderContext
Microsoft.Extensions.Hosting (2)
88 references to HostBuilderContext
Microsoft.AspNetCore (17)
Microsoft.AspNetCore.Hosting (6)
GenericHost\GenericWebHostBuilder.cs (5)
98private void ScanAssemblyAndRegisterStartup(HostBuilderContext context, IServiceCollection services, WebHostBuilderContext webhostContext, WebHostOptions webHostOptions)
201void ConfigureStartup(HostBuilderContext context, IServiceCollection services)
215private void UseStartup([DynamicallyAccessedMembers(StartupLinkerOptions.Accessibility)] Type startupType, HostBuilderContext context, IServiceCollection services, object? instance = null)
291var actionType = typeof(Action<,>).MakeGenericType(typeof(HostBuilderContext), containerType);
305private void ConfigureContainerImpl<TContainer>(HostBuilderContext context, TContainer container) where TContainer : notnull
Microsoft.AspNetCore.Mvc.Testing (4)
Microsoft.AspNetCore.Tests (1)
Microsoft.Extensions.Hosting (40)
HostApplicationBuilder.cs (10)
22private readonly HostBuilderContext _hostBuilderContext;
136private void Initialize(HostApplicationBuilderSettings settings, out HostBuilderContext hostBuilderContext, out IHostEnvironment environment, out LoggingBuilder logging, out MetricsBuilder metrics)
259private readonly List<Action<HostBuilderContext, IConfigurationBuilder>> _configureAppConfigActions = new();
261private readonly List<Action<HostBuilderContext, IServiceCollection>> _configureServicesActions = new();
306foreach (Action<HostBuilderContext, IConfigurationBuilder> configureAppAction in _configureAppConfigActions)
310foreach (Action<HostBuilderContext, IServiceCollection> configureServicesAction in _configureServicesActions)
352public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate)
360public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate)
377public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
385public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate)
HostBuilder.cs (13)
29private readonly List<Action<HostBuilderContext, IConfigurationBuilder>> _configureAppConfigActions = new List<Action<HostBuilderContext, IConfigurationBuilder>>();
30private readonly List<Action<HostBuilderContext, IServiceCollection>> _configureServicesActions = new List<Action<HostBuilderContext, IServiceCollection>>();
36private HostBuilderContext? _hostBuilderContext;
73/// the results will be additive. The results will be available at <see cref="HostBuilderContext.Configuration"/> for
79public IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, IConfigurationBuilder> configureDelegate)
93public IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate)
122public IHostBuilder UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factory) where TContainerBuilder : notnull
139public IHostBuilder ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext, TContainerBuilder> configureDelegate)
283foreach (Action<HostBuilderContext, IConfigurationBuilder> buildAction in _configureAppConfigActions)
294HostBuilderContext hostBuilderContext,
346foreach (Action<HostBuilderContext, IServiceCollection> configureServicesAction in _configureServicesActions)
HostingHostBuilderExtensions.cs (9)
82public static IHostBuilder UseDefaultServiceProvider(this IHostBuilder hostBuilder, Action<HostBuilderContext, ServiceProviderOptions> configure)
98public static IHostBuilder ConfigureLogging(this IHostBuilder hostBuilder, Action<HostBuilderContext, ILoggingBuilder> configureLogging)
120public static IHostBuilder ConfigureHostOptions(this IHostBuilder hostBuilder, Action<HostBuilderContext, HostOptions> configureOptions)
139/// the results will be additive. The results will be available at <see cref="HostBuilderContext.Configuration"/> for
236internal static void ApplyDefaultAppConfiguration(HostBuilderContext hostingContext, IConfigurationBuilder appConfigBuilder, string[]? args)
262static bool GetReloadConfigOnChangeValue(HostBuilderContext hostingContext) => hostingContext.Configuration.GetValue("hostBuilder:reloadConfigOnChange", defaultValue: true);
273internal static void AddDefaultServices(HostBuilderContext hostingContext, IServiceCollection services)
325internal static ServiceProviderOptions CreateDefaultServiceProviderOptions(HostBuilderContext context)
418public static IHostBuilder ConfigureMetrics(this IHostBuilder hostBuilder, Action<HostBuilderContext, IMetricsBuilder> configureMetrics)
Microsoft.Extensions.Hosting.Abstractions (7)
Microsoft.Extensions.Hosting.Systemd (1)
Microsoft.Extensions.Hosting.Testing (4)
Microsoft.Extensions.Hosting.Testing.Tests (6)
Microsoft.Extensions.Hosting.WindowsServices (2)