1 interface inheriting from IHostEnvironment
Microsoft.AspNetCore.Hosting.Abstractions (1)
IWebHostEnvironment.cs (1)
12public interface IWebHostEnvironment : IHostEnvironment
7 implementations of IHostEnvironment
Aspire.Dashboard.Tests (1)
BrowserSecurityHeadersMiddlewareTests.cs (1)
88private sealed class TestHostEnvironment : IHostEnvironment
Aspire.Hosting.Tests (1)
Dashboard\DashboardServiceTests.cs (1)
148private sealed class TestHostEnvironment : IHostEnvironment
Microsoft.AspNetCore.Mvc.ApiExplorer.Test (1)
EndpointMetadataApiDescriptionProviderTest.cs (1)
1607private class HostEnvironment : IHostEnvironment
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiGeneratorTests.cs (1)
1028internal class HostEnvironment : IHostEnvironment
Microsoft.AspNetCore.Routing.Tests (1)
RouteHandlerOptionsTests.cs (1)
69private class HostEnvironment : IHostEnvironment
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
1874private class MockHostingEnvironment : IHostEnvironment
Microsoft.Extensions.Hosting (1)
Internal\HostingEnvironment.cs (1)
15public class HostingEnvironment : IHostingEnvironment, IHostEnvironment
247 references to IHostEnvironment
Aspire.Dashboard (2)
Model\BrowserSecurityHeadersMiddleware.cs (2)
20public BrowserSecurityHeadersMiddleware(RequestDelegate next, IHostEnvironment environment) 28private static string GenerateCspContent(IHostEnvironment environment, bool isHttps)
Aspire.Hosting (4)
Dashboard\DashboardService.cs (1)
21internal sealed partial class DashboardService(DashboardServiceData serviceData, IHostEnvironment hostEnvironment, IHostApplicationLifetime hostApplicationLifetime, ILogger<DashboardService> logger)
DistributedApplicationBuilder.cs (1)
55public IHostEnvironment Environment => _innerBuilder.Environment;
IDistributedApplicationBuilder.cs (1)
69public IHostEnvironment Environment { get; }
OtlpConfigurationExtensions.cs (1)
28public static void AddOtlpEnvironment(IResource resource, IConfiguration configuration, IHostEnvironment environment)
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\AzureProvisioner.cs (1)
34IHostEnvironment environment,
Aspire.Hosting.Containers.Tests (1)
src\Aspire.Hosting.Testing\ResourceLoggerForwarderService.cs (1)
18IHostEnvironment hostEnvironment,
Aspire.Hosting.Dapr (2)
DaprDistributedApplicationLifecycleHook.cs (2)
21private readonly IHostEnvironment _environment; 27public DaprDistributedApplicationLifecycleHook(IConfiguration configuration, IHostEnvironment environment, ILogger<DaprDistributedApplicationLifecycleHook> logger, IOptions<DaprOptions> options)
Aspire.Hosting.Testing (3)
DistributedApplicationTestingBuilder.cs (2)
166public IHostEnvironment Environment => innerBuilder.Environment; 257IHostEnvironment Environment { get; }
ResourceLoggerForwarderService.cs (1)
18IHostEnvironment hostEnvironment,
Aspire.Hosting.Testing.Tests (4)
TestingBuilderTests.cs (2)
190var hostEnvironment = app.Services.GetRequiredService<IHostEnvironment>();
TestingFactoryTests.cs (2)
61var appModel = _app.Services.GetRequiredService<IHostEnvironment>();
Aspire.Hosting.Tests (2)
src\Aspire.Hosting.Testing\ResourceLoggerForwarderService.cs (1)
18IHostEnvironment hostEnvironment,
Utils\TestDistributedApplicationBuilder.cs (1)
126public IHostEnvironment Environment => _innerBuilder.Environment;
Aspire.Keycloak.Authentication (2)
AspireKeycloakExtensions.cs (2)
87.Configure<IConfiguration, IHttpClientFactory, IHostEnvironment>((options, configuration, httpClientFactory, hostEnvironment) => 166.Configure<IConfiguration, IHttpClientFactory, IHostEnvironment>((options, configuration, httpClientFactory, hostEnvironment) =>
Aspire.Playground.Tests (4)
Infrastructure\DistributedApplicationExtensions.cs (4)
113var environment = app.Services.GetRequiredService<IHostEnvironment>(); 131var environment = app.Services.GetRequiredService<IHostEnvironment>();
CatalogService (1)
CatalogApi.cs (1)
31group.MapGet("items/{catalogItemId:int}/image", async (int catalogItemId, CatalogDbContext catalogDbContext, IHostEnvironment environment) =>
CreateDefaultBuilderOfTApp (2)
Program.cs (2)
44var hostingEnvironment = app.ApplicationServices.GetRequiredService<IHostEnvironment>();
InMemory.FunctionalTests (2)
HttpsConnectionMiddlewareTests.cs (1)
36var env = new Mock<IHostEnvironment>();
HttpsTests.cs (1)
41.AddSingleton(Mock.Of<IHostEnvironment>())
IStartupInjectionAssemblyName (1)
Program.cs (1)
15var applicationName = webHost.Services.GetRequiredService<IHostEnvironment>().ApplicationName;
Kestrel.SampleApp (1)
Startup.cs (1)
179var env = hostingContext.HostingEnvironment;
Microsoft.AspNetCore (12)
WebApplicationBuilder.cs (2)
267private static void ApplyDefaultAppConfigurationSlim(IHostEnvironment env, ConfigurationManager configuration, string[]? args) 370IHostEnvironment IHostApplicationBuilder.Environment => Environment;
WebHost.cs (10)
123/// set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>, 124/// load <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json', 125/// load <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly, 142/// set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>, 143/// load <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json', 144/// load <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly, 148/// configure the <see cref="IWebHostEnvironment.WebRootFileProvider"/> to map static web assets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly, 292/// set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>, 293/// load <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json', 294/// load <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly,
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
72return _httpContext.RequestServices.GetService<IHostEnvironment>()?.IsDevelopment() == true
Microsoft.AspNetCore.Components.Endpoints.Tests (4)
EndpointHtmlRendererTest.cs (4)
888.AddSingleton<IHostEnvironment>(new TestEnvironment(Environments.Development)) 917.AddSingleton<IHostEnvironment>(new TestEnvironment(Environments.Development)) 1010.AddSingleton<IHostEnvironment>(new TestEnvironment(Environments.Development)) 1771private class TestEnvironment(string environmentName) : IHostEnvironment
Microsoft.AspNetCore.DataProtection (2)
Internal\HostingApplicationDiscriminator.cs (2)
13private readonly IHostEnvironment? _hosting; 22public HostingApplicationDiscriminator(IHostEnvironment hosting)
Microsoft.AspNetCore.DataProtection.Tests (3)
DataProtectionUtilityExtensionsTests.cs (3)
30var mockEnvironment = new Mock<IHostEnvironment>(); 61var mockEnvironment = new Mock<IHostEnvironment>(); 88var mockEnvironment = new Mock<IHostEnvironment>();
Microsoft.AspNetCore.Hosting (14)
GenericHost\GenericWebHostBuilder.cs (1)
377|| serviceType == typeof(IHostEnvironment)
Internal\HostingEnvironmentExtensions.cs (1)
64IHostEnvironment? baseEnvironment = null)
Internal\WebHost.cs (2)
245var hostingEnv = _applicationServices.GetRequiredService<IHostEnvironment>();
Internal\WebHostOptions.cs (1)
14public WebHostOptions(IConfiguration primaryConfiguration, IConfiguration? fallbackConfiguration = null, IHostEnvironment? environment = null)
WebHostBuilder.cs (3)
268services.AddSingleton<IHostEnvironment>(_hostingEnvironment); 331var hostingEnvironment = serviceProvider.GetRequiredService<IHostEnvironment>();
WebHostBuilderExtensions.cs (4)
114var hostingEnvironment = serviceProvider.GetRequiredService<IHostEnvironment>(); 158var hostingEnvironment = sp.GetRequiredService<IHostEnvironment>();
WebHostExtensions.cs (2)
114var hostingEnvironment = host.Services.GetService<IHostEnvironment>();
Microsoft.AspNetCore.Hosting.Tests (27)
Fakes\StartupWithHostingEnvironment.cs (1)
11public StartupWithHostingEnvironment(IHostEnvironment env)
WebHostBuilderTests.cs (18)
611Assert.Equal(expected, host.Services.GetService<IHostEnvironment>().EnvironmentName); 659Assert.Equal("/", host.Services.GetService<IHostEnvironment>().ContentRootPath); 678var basePath = host.Services.GetRequiredService<IHostEnvironment>().ContentRootPath; 701Assert.Equal(appBase, host.Services.GetService<IHostEnvironment>().ContentRootPath); 732var hostingEnv = host.Services.GetService<IHostEnvironment>(); 750var hostingEnv = host.Services.GetService<IHostEnvironment>(); 768var hostingEnv = host.Services.GetService<IHostEnvironment>(); 781var hostingEnv = host.Services.GetService<IHostEnvironment>(); 797var hostingEnv = host.Services.GetService<IHostEnvironment>(); 813var hostingEnv = host.Services.GetService<IHostEnvironment>(); 827var hostingEnv = host.Services.GetService<IHostEnvironment>();
WebHostTests.cs (8)
714var env = host.Services.GetService<IHostEnvironment>(); 801var env = host.Services.GetService<IHostEnvironment>(); 824var env = host.Services.GetService<IHostEnvironment>(); 865var env = host.Services.GetRequiredService<IHostEnvironment>();
Microsoft.AspNetCore.HttpLogging (2)
FileLoggerProcessor.cs (1)
40public FileLoggerProcessor(IOptionsMonitor<W3CLoggerOptions> options, IHostEnvironment environment, ILoggerFactory factory)
W3CLoggerProcessor.cs (1)
19public W3CLoggerProcessor(IOptionsMonitor<W3CLoggerOptions> options, IHostEnvironment environment, ILoggerFactory factory) : base(options, environment, factory)
Microsoft.AspNetCore.HttpLogging.Tests (1)
TestW3CLoggerProcessor.cs (1)
18public TestW3CLoggerProcessor(IOptionsMonitor<W3CLoggerOptions> options, IHostEnvironment environment, ILoggerFactory factory) : base(options, environment, factory)
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
EndpointMetadataApiDescriptionProvider.cs (2)
25private readonly IHostEnvironment _environment; 34IHostEnvironment environment,
Microsoft.AspNetCore.Mvc.Test (1)
MvcServiceCollectionExtensionsTest.cs (1)
400services.AddSingleton<IHostEnvironment>(hostEnvironment);
Microsoft.AspNetCore.OpenApi (6)
Extensions\OpenApiEndpointConventionBuilderExtensions.cs (2)
106var hostEnvironment = applicationServices.GetService<IHostEnvironment>();
Services\OpenApiDocumentService.cs (1)
35IHostEnvironment hostEnvironment,
Services\OpenApiGenerator.cs (3)
33private readonly IHostEnvironment? _environment; 37/// Creates an <see cref="OpenApiGenerator" /> instance given an <see cref="IHostEnvironment" /> 43IHostEnvironment? environment,
Microsoft.AspNetCore.OpenApi.Tests (9)
Extensions\OpenApiEndpointRouteBuilderExtensionsTests.cs (1)
186.AddSingleton<IHostEnvironment>(hostEnvironment)
Extensions\OpenApiRouteHandlerBuilderExtensionTests.cs (7)
23.AddSingleton<IHostEnvironment>(hostEnvironment) 46.AddSingleton<IHostEnvironment>(hostEnvironment) 69.AddSingleton<IHostEnvironment>(hostEnvironment) 97.AddSingleton<IHostEnvironment>(hostEnvironment) 126.AddSingleton<IHostEnvironment>(hostEnvironment) 158.AddSingleton<IHostEnvironment>(hostEnvironment) 188.AddSingleton<IHostEnvironment>(hostEnvironment)
Services\OpenApiDocumentProviderTests.cs (1)
65.AddSingleton<IHostEnvironment>(hostEnvironment)
Microsoft.AspNetCore.Routing (3)
ConfigureRouteHandlerOptions.cs (2)
11private readonly IHostEnvironment? _environment; 13public ConfigureRouteHandlerOptions(IHostEnvironment? environment = null)
RouteHandlerOptions.cs (1)
22/// Defaults to <see cref="HostEnvironmentEnvExtensions.IsDevelopment(IHostEnvironment)"/>.
Microsoft.AspNetCore.Routing.Tests (3)
Builder\EndpointRoutingApplicationBuilderExtensionsTest.cs (1)
365services.AddSingleton(Mock.Of<IHostEnvironment>());
RouteHandlerOptionsTests.cs (2)
23services.AddSingleton<IHostEnvironment>(new HostEnvironment 43services.AddSingleton<IHostEnvironment>(new HostEnvironment
Microsoft.AspNetCore.Server.Kestrel.Core (18)
HttpsConfigurationService.cs (3)
58IHostEnvironment hostEnvironment, 243private readonly IHostEnvironment _hostEnvironment; 248IHostEnvironment hostEnvironment,
IHttpsConfigurationService.cs (1)
32IHostEnvironment hostEnvironment,
Internal\CertificatePathWatcher.cs (1)
30public CertificatePathWatcher(IHostEnvironment hostEnvironment, ILogger<CertificatePathWatcher> logger)
Internal\Certificates\CertificateConfigLoader.cs (2)
15public CertificateConfigLoader(IHostEnvironment hostEnvironment, ILogger<KestrelServer> logger) 21public IHostEnvironment HostEnvironment { get; }
KestrelServer.cs (1)
82public void Initialize(IHostEnvironment hostEnvironment, ILogger<KestrelServer> serverLogger, ILogger<HttpsConnectionMiddleware> httpsLogger)
KestrelServerOptions.cs (3)
326var hostEnvironment = ApplicationServices.GetRequiredService<IHostEnvironment>(); 461ApplicationServices.GetRequiredService<IHostEnvironment>(),
ListenOptionsHttpsExtensions.cs (6)
38var env = listenOptions.ApplicationServices.GetRequiredService<IHostEnvironment>(); 52var env = listenOptions.ApplicationServices.GetRequiredService<IHostEnvironment>(); 67var env = listenOptions.ApplicationServices.GetRequiredService<IHostEnvironment>();
TlsConfigurationLoader.cs (1)
30IHostEnvironment hostEnvironment,
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (5)
KestrelServerOptionsTests.cs (1)
84serviceCollection.AddSingleton(Mock.Of<IHostEnvironment>());
KestrelServerTests.cs (4)
39.AddSingleton(Mock.Of<IHostEnvironment>()) 301serviceProvider.GetRequiredService<IHostEnvironment>(), 789serviceCollection.AddSingleton(Mock.Of<IHostEnvironment>()); 928serviceCollection.AddSingleton(Mock.Of<IHostEnvironment>());
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
KestrelConfigurationLoaderTests.cs (1)
29.AddSingleton<IHostEnvironment>(env)
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsEndpointRouteBuilderExtensions.cs (1)
23/// The <paramref name="staticAssetsManifestPath"/> can be <see langword="null"/> to use the <see cref="IHostEnvironment.ApplicationName"/> to locate the manifest.
Microsoft.AspNetCore.Tests (14)
WebApplicationTests.cs (14)
950var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 992var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 1060var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 1478var env0 = app.Services.GetRequiredService<IHostEnvironment>(); 1480var env1 = app.Services.GetRequiredService<IServiceCollection>().BuildServiceProvider().GetRequiredService<IHostEnvironment>(); 2255var hostEnv = app.Services.GetRequiredService<IHostEnvironment>(); 2285var hostEnv = app.Services.GetRequiredService<IHostEnvironment>();
Microsoft.Extensions.AmbientMetadata.Application (5)
ApplicationMetadataConfigurationBuilderExtensions.cs (2)
22/// <param name="hostEnvironment">An instance of <see cref="IHostEnvironment" />.</param> 27public static IConfigurationBuilder AddApplicationMetadata(this IConfigurationBuilder builder, IHostEnvironment hostEnvironment, string sectionName = DefaultSectionName)
ApplicationMetadataSource.cs (3)
17private readonly IHostEnvironment _hostEnvironment; 22/// <param name="hostEnvironment">An instance of <see cref="IHostEnvironment"/>.</param> 26public ApplicationMetadataSource(IHostEnvironment hostEnvironment, string sectionName)
Microsoft.Extensions.AmbientMetadata.Application.Tests (4)
AcceptanceTests.cs (2)
42private static async Task RunAsync(Func<ApplicationMetadata, IHostEnvironment, Task> func, string? sectionName) 60host.Services.GetRequiredService<IHostEnvironment>());
ApplicationMetadataExtensionsTests.cs (1)
24private readonly Mock<IHostEnvironment> _hostEnvironment = new();
ApplicationMetadataSourceTests.cs (1)
19private readonly Mock<IHostEnvironment> _hostEnvironment = new();
Microsoft.Extensions.Hosting (44)
Host.cs (16)
21/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 23/// <item><description>load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json'</description></item> 24/// <item><description>load app <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly</description></item> 27/// <item><description>enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'</description></item> 40/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 43/// <item><description>load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json'</description></item> 44/// <item><description>load app <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly</description></item> 48/// <item><description>enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'</description></item> 65/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 67/// <item><description>load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json'</description></item> 68/// <item><description>load app <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly</description></item> 71/// <item><description>enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'</description></item> 83/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 86/// <item><description>load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json'</description></item> 87/// <item><description>load app <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly</description></item> 91/// <item><description>enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'</description></item>
HostApplicationBuilder.cs (11)
24private readonly IHostEnvironment _environment; 41/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 44/// <item><description>load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json'</description></item> 45/// <item><description>load app <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly</description></item> 49/// <item><description>enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'</description></item> 63/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 66/// <item><description>load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json'</description></item> 67/// <item><description>load app <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly</description></item> 71/// <item><description>enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'</description></item> 136private void Initialize(HostApplicationBuilderSettings settings, out HostBuilderContext hostBuilderContext, out IHostEnvironment environment, out LoggingBuilder logging, out MetricsBuilder metrics) 191public IHostEnvironment Environment => _environment;
HostApplicationBuilderSettings.cs (4)
31/// * set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/> 33/// * load <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json' 34/// * load <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly 38/// * enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'
HostBuilder.cs (2)
57/// Set up the configuration for the builder itself. This will be used to initialize the <see cref="IHostEnvironment"/> 303services.AddSingleton<IHostEnvironment>(hostingEnvironment);
HostingHostBuilderExtensions.cs (5)
181/// * set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/> 184/// * load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json' 185/// * load app <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly 189/// * enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' 238IHostEnvironment env = hostingContext.HostingEnvironment;
Internal\ConsoleLifetime.cs (3)
34public ConsoleLifetime(IOptions<ConsoleLifetimeOptions> options, IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, IOptions<HostOptions> hostOptions) 46public ConsoleLifetime(IOptions<ConsoleLifetimeOptions> options, IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, IOptions<HostOptions> hostOptions, ILoggerFactory loggerFactory) 63private IHostEnvironment Environment { get; }
Internal\Host.cs (3)
27private readonly IHostEnvironment _hostEnvironment; 35IHostEnvironment hostEnvironment, 451public IHostEnvironment Environment => host._hostEnvironment;
Microsoft.Extensions.Hosting.Abstractions (17)
HostBuilderContext.cs (2)
27/// The <see cref="IHostEnvironment" /> initialized by the <see cref="IHost" />. 29public IHostEnvironment HostingEnvironment { get; set; } = null!;
HostDefaults.cs (4)
12/// The configuration key used to set <see cref="IHostEnvironment.ApplicationName"/>. 17/// The configuration key used to set <see cref="IHostEnvironment.EnvironmentName"/>. 22/// The configuration key used to set <see cref="IHostEnvironment.ContentRootPath"/> 23/// and <see cref="IHostEnvironment.ContentRootFileProvider"/>.
HostEnvironmentEnvExtensions.cs (9)
9/// Extension methods for <see cref="IHostEnvironment"/>. 16/// <param name="hostEnvironment">An instance of <see cref="IHostEnvironment"/>.</param> 18public static bool IsDevelopment(this IHostEnvironment hostEnvironment) 28/// <param name="hostEnvironment">An instance of <see cref="IHostEnvironment"/>.</param> 30public static bool IsStaging(this IHostEnvironment hostEnvironment) 40/// <param name="hostEnvironment">An instance of <see cref="IHostEnvironment"/>.</param> 42public static bool IsProduction(this IHostEnvironment hostEnvironment) 52/// <param name="hostEnvironment">An instance of <see cref="IHostEnvironment"/>.</param> 56this IHostEnvironment hostEnvironment,
IHostApplicationBuilder.cs (1)
34IHostEnvironment Environment { get; }
IHostBuilder.cs (1)
22/// Sets up the configuration for the builder itself. This will be used to initialize the <see cref="IHostEnvironment"/>
Microsoft.Extensions.Hosting.Systemd (2)
SystemdLifetime.cs (2)
32public SystemdLifetime(IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, ISystemdNotifier systemdNotifier, ILoggerFactory loggerFactory) 46private IHostEnvironment Environment { get; }
Microsoft.Extensions.Hosting.WindowsServices (4)
WindowsServiceLifetime.cs (3)
33public WindowsServiceLifetime(IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory, IOptions<HostOptions> optionsAccessor) 46public WindowsServiceLifetime(IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, ILoggerFactory loggerFactory, IOptions<HostOptions> optionsAccessor, IOptions<WindowsServiceLifetimeOptions> windowsServiceOptionsAccessor) 63private IHostEnvironment Environment { get; }
WindowsServiceLifetimeHostBuilderExtensions.cs (1)
129public EventLogSettingsSetup(IHostEnvironment environment)
Microsoft.Extensions.Telemetry.Tests (2)
Enrichment\ApplicationLogEnricherTests.cs (2)
21private readonly Mock<IHostEnvironment> _hostMock; 25_hostMock = new Mock<IHostEnvironment>(MockBehavior.Strict);
SimpleWebSiteWithWebApplicationBuilder (1)
Program.cs (1)
42app.MapGet("/environment", (IHostEnvironment environment) => environment.EnvironmentName);
StartRequestDelegateUrlApp (2)
Program.cs (2)
23var env = context.RequestServices.GetRequiredService<IHostEnvironment>();
StartRouteBuilderUrlApp (2)
Program.cs (2)
24var env = req.HttpContext.RequestServices.GetRequiredService<IHostEnvironment>();
StartWithIApplicationBuilderUrlApp (2)
Program.cs (2)
26var env = context.RequestServices.GetRequiredService<IHostEnvironment>();
TestProject.AppHost (1)
src\Aspire.Hosting.Testing\ResourceLoggerForwarderService.cs (1)
18IHostEnvironment hostEnvironment,