1 interface inheriting from IHostEnvironment
Microsoft.AspNetCore.Hosting.Abstractions (1)
IWebHostEnvironment.cs (1)
12public interface IWebHostEnvironment : IHostEnvironment
9 implementations of IHostEnvironment
Aspire.Dashboard.Tests (1)
BrowserSecurityHeadersMiddlewareTests.cs (1)
90private sealed class TestHostEnvironment : IHostEnvironment
Aspire.Hosting.Azure.Tests (1)
ProvisioningTestHelpers.cs (1)
1025internal sealed class TestHostEnvironment : IHostEnvironment
Aspire.Hosting.Docker.Tests (1)
DockerComposePublisherTests.cs (1)
1372private sealed class TestHostEnvironment(string environmentName) : Microsoft.Extensions.Hosting.IHostEnvironment
Aspire.Hosting.RemoteHost.Tests (1)
AtsExportsTests.cs (1)
184private sealed class TestHostEnvironment : IHostEnvironment
Aspire.Hosting.Tests (3)
Dashboard\DashboardServiceTests.cs (1)
1884private sealed class TestHostEnvironment : IHostEnvironment
Dcp\DcpExecutorTests.cs (1)
11644private sealed class TestHostEnvironment : IHostEnvironment
Publishing\DeploymentStateManagerTests.cs (1)
1344private sealed class TestHostEnvironment : IHostEnvironment
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHostEnvironmentAdapter.cs (1)
9internal sealed class WebAssemblyHostEnvironmentAdapter : IHostEnvironment
Microsoft.Extensions.Hosting (1)
Internal\HostingEnvironment.cs (1)
15public class HostingEnvironment : IHostingEnvironment, IHostEnvironment
229 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 (17)
Ats\AtsTypeMappings.cs (1)
67[assembly: AspireExport(typeof(IHostEnvironment), ExposeProperties = true)]
Ats\BuilderExports.cs (4)
139public static bool IsDevelopment(this IHostEnvironment environment) 152public static bool IsProduction(this IHostEnvironment environment) 165public static bool IsStaging(this IHostEnvironment environment) 179public static bool IsEnvironment(this IHostEnvironment environment, string environmentName)
Dashboard\DashboardService.cs (1)
43internal sealed partial class DashboardService(DashboardServiceData serviceData, IHostEnvironment hostEnvironment, IHostApplicationLifetime hostApplicationLifetime, IConfiguration configuration, ILogger<DashboardService> logger, IInteractionFileUploadStore fileUploadStore, TerminalService terminalService)
Dcp\ContainerNetworkEndpointProvisioner.cs (1)
79IHostEnvironment hostEnvironment,
DistributedApplicationBuilder.cs (1)
83public IHostEnvironment Environment => _innerBuilder.Environment;
IDistributedApplicationBuilder.cs (1)
73public IHostEnvironment Environment { get; }
OtlpConfigurationExtensions.cs (3)
23public static void AddOtlpEnvironment(IResource resource, IConfiguration configuration, IHostEnvironment environment) 42public static void AddOtlpEnvironment(IResource resource, IConfiguration configuration, IHostEnvironment environment, OtlpProtocol protocol) 85IHostEnvironment environment,
Pipelines\DistributedApplicationPipeline.cs (2)
70var hostEnvironment = context.Services.GetRequiredService<IHostEnvironment>();
Pipelines\Internal\FileDeploymentStateManager.cs (1)
22IHostEnvironment hostEnvironment,
ResourceLoggerForwarderService.cs (1)
18IHostEnvironment hostEnvironment,
TerminalResourceBuilderExtensions.cs (1)
220OtlpConfigurationExtensions.AddOtlpEnvironment(terminalHost, configuration, @event.Services.GetRequiredService<IHostEnvironment>());
Aspire.Hosting.Azure (4)
Provisioning\Internal\BaseProvisioningContextProvider.cs (2)
21IHostEnvironment environment, 51protected readonly IHostEnvironment _environment = environment;
Provisioning\Internal\PublishModeProvisioningContextProvider.cs (1)
21IHostEnvironment environment,
Provisioning\Internal\RunModeProvisioningContextProvider.cs (1)
23IHostEnvironment environment,
Aspire.Hosting.Azure.Sandboxes (3)
AzureSandboxContainerDeployment.cs (3)
245var environmentName = context.Services.GetRequiredService<IHostEnvironment>().EnvironmentName; 1312var environmentName = context.Services.GetRequiredService<IHostEnvironment>().EnvironmentName; 1410context.Services.GetRequiredService<IHostEnvironment>().EnvironmentName,
Aspire.Hosting.Azure.Sql (1)
AzureSqlServerResource.cs (1)
769public IHostEnvironment Environment => throw new NotImplementedException();
Aspire.Hosting.Azure.Tests (22)
AzureDeployerTests.cs (2)
1742var environment = ProvisioningTestHelpers.CreateEnvironment(); 2213builder.Services.AddSingleton<IHostEnvironment>(environment);
ProvisioningContextProviderTests.cs (18)
215var environment = ProvisioningTestHelpers.CreateEnvironment(); 254var environment = ProvisioningTestHelpers.CreateEnvironment(); 285var environment = ProvisioningTestHelpers.CreateEnvironment(); 321var environment = ProvisioningTestHelpers.CreateEnvironment(); 358var environment = ProvisioningTestHelpers.CreateEnvironment(); 388var environment = ProvisioningTestHelpers.CreateEnvironment(); 421var environment = ProvisioningTestHelpers.CreateEnvironment(); 453var environment = ProvisioningTestHelpers.CreateEnvironment(); 486var environment = ProvisioningTestHelpers.CreateEnvironment(); 520var environment = ProvisioningTestHelpers.CreateEnvironment(); 616var environment = ProvisioningTestHelpers.CreateEnvironment(); 677var environment = ProvisioningTestHelpers.CreateEnvironment(); 779var environment = ProvisioningTestHelpers.CreateEnvironment(); 820var environment = ProvisioningTestHelpers.CreateEnvironment(); 867var environment = ProvisioningTestHelpers.CreateEnvironment(); 911var environment = ProvisioningTestHelpers.CreateEnvironment(); 970var environment = ProvisioningTestHelpers.CreateEnvironment(); 1014var environment = ProvisioningTestHelpers.CreateEnvironment();
ProvisioningTestHelpers.cs (2)
121public static IHostEnvironment CreateEnvironment() 1023/// Test implementation of <see cref="IHostEnvironment"/>.
Aspire.Hosting.Docker (2)
DockerComposeEnvironmentResource.cs (2)
596var hostEnvironment = context.Services.GetService<Microsoft.Extensions.Hosting.IHostEnvironment>();
Aspire.Hosting.Docker.Tests (2)
DockerComposePublisherTests.cs (2)
791builder.Services.AddSingleton<Microsoft.Extensions.Hosting.IHostEnvironment>(new TestHostEnvironment("Staging")); 885builder.Services.AddSingleton<Microsoft.Extensions.Hosting.IHostEnvironment>(new TestHostEnvironment("Staging"));
Aspire.Hosting.Kubernetes (2)
Deployment\HelmDeploymentEngine.cs (2)
59var hostEnvironment = context.Services.GetRequiredService<IHostEnvironment>();
Aspire.Hosting.Testing (3)
DistributedApplicationTestingBuilder.cs (3)
518public IHostEnvironment Environment => innerBuilder.Environment; 683public IHostEnvironment Environment => _innerBuilder.Environment; 772new IHostEnvironment Environment => ((IDistributedApplicationBuilder)this).Environment;
Aspire.Hosting.Testing.Tests (4)
TestingBuilderTests.cs (2)
427var hostEnvironment = app.Services.GetRequiredService<IHostEnvironment>();
TestingFactoryTests.cs (2)
65var appModel = _app.Services.GetRequiredService<IHostEnvironment>();
Aspire.Hosting.Tests (3)
Dashboard\DashboardServiceTests.cs (1)
1836IHostEnvironment? hostEnvironment = null,
Dcp\DcpExecutorTests.cs (2)
11377IHostEnvironment? hostEnvironment = null, 11427var hostEnv = hostEnvironment ?? new TestHostEnvironment();
Aspire.Keycloak.Authentication (2)
AspireKeycloakExtensions.cs (2)
90.Configure<IConfiguration, IHttpClientFactory, IHostEnvironment>((options, configuration, httpClientFactory, hostEnvironment) => 172.Configure<IConfiguration, IHttpClientFactory, IHostEnvironment>((options, configuration, httpClientFactory, hostEnvironment) =>
Aspire.Playground.Tests (4)
Infrastructure\DistributedApplicationExtensions.cs (4)
115var environment = app.Services.GetRequiredService<IHostEnvironment>(); 133var environment = app.Services.GetRequiredService<IHostEnvironment>();
CatalogService (1)
CatalogApi.cs (1)
31group.MapGet("items/{catalogItemId:int}/image", async (int catalogItemId, CatalogDbContext catalogDbContext, IHostEnvironment environment) =>
Microsoft.AspNetCore (12)
WebApplicationBuilder.cs (2)
292private static void ApplyDefaultAppConfigurationSlim(IHostEnvironment env, ConfigurationManager configuration, string[]? args) 395IHostEnvironment IHostApplicationBuilder.Environment => Environment;
WebHost.cs (10)
127/// set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>, 128/// load <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json', 129/// load <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly, 146/// set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>, 147/// load <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json', 148/// load <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly, 152/// configure the <see cref="IWebHostEnvironment.WebRootFileProvider"/> to map static web assets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly, 301/// set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/>, 302/// load <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json', 303/// load <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly,
Microsoft.AspNetCore.Components.Endpoints (3)
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
77return _httpContext.RequestServices.GetService<IHostEnvironment>()?.IsDevelopment() == true
Rendering\EndpointHtmlRenderer.Streaming.cs (2)
449var hostEnvironment = _httpContext.RequestServices.GetRequiredService<IHostEnvironment>();
Microsoft.AspNetCore.Components.Web (1)
EnvironmentView.cs (1)
41private IHostEnvironment HostEnvironment { get; set; } = default!;
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHostBuilder.cs (1)
200Services.AddSingleton<IHostEnvironment>(sp => new WebAssemblyHostEnvironmentAdapter(sp.GetRequiredService<IWebAssemblyHostEnvironment>()));
Microsoft.AspNetCore.DataProtection (2)
Internal\HostingApplicationDiscriminator.cs (2)
13private readonly IHostEnvironment? _hosting; 22public HostingApplicationDiscriminator(IHostEnvironment hosting)
Microsoft.AspNetCore.Hosting (14)
GenericHost\GenericWebHostBuilder.cs (1)
385|| serviceType == typeof(IHostEnvironment)
Internal\HostingEnvironmentExtensions.cs (1)
64IHostEnvironment? baseEnvironment = null)
Internal\WebHost.cs (2)
246var hostingEnv = _applicationServices.GetRequiredService<IHostEnvironment>();
Internal\WebHostOptions.cs (1)
14public WebHostOptions(IConfiguration primaryConfiguration, IConfiguration? fallbackConfiguration = null, IHostEnvironment? environment = null)
WebHostBuilder.cs (3)
270services.AddSingleton<IHostEnvironment>(_hostingEnvironment); 333var 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.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.Mvc.ApiExplorer (2)
EndpointMetadataApiDescriptionProvider.cs (2)
25private readonly IHostEnvironment _environment; 34IHostEnvironment environment,
Microsoft.AspNetCore.OpenApi (6)
Extensions\OpenApiEndpointConventionBuilderExtensions.cs (2)
108var hostEnvironment = applicationServices.GetService<IHostEnvironment>();
Services\OpenApiDocumentService.cs (1)
38IHostEnvironment hostEnvironment,
Services\OpenApiGenerator.cs (3)
34private readonly IHostEnvironment? _environment; 38/// Creates an <see cref="OpenApiGenerator" /> instance given an <see cref="IHostEnvironment" /> 44IHostEnvironment? environment,
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.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)
16public CertificateConfigLoader(IHostEnvironment hostEnvironment, ILogger<KestrelServer> logger) 22public IHostEnvironment HostEnvironment { get; }
KestrelServer.cs (1)
84public void Initialize(IHostEnvironment hostEnvironment, ILogger<KestrelServer> serverLogger, ILogger<HttpsConnectionMiddleware> httpsLogger)
KestrelServerOptions.cs (3)
339var hostEnvironment = ApplicationServices.GetRequiredService<IHostEnvironment>(); 474ApplicationServices.GetRequiredService<IHostEnvironment>(),
ListenOptionsHttpsExtensions.cs (6)
42var env = listenOptions.ApplicationServices.GetRequiredService<IHostEnvironment>(); 56var env = listenOptions.ApplicationServices.GetRequiredService<IHostEnvironment>(); 71var env = listenOptions.ApplicationServices.GetRequiredService<IHostEnvironment>();
TlsConfigurationLoader.cs (1)
30IHostEnvironment hostEnvironment,
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.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 (6)
AcceptanceTests.cs (4)
58private static async Task RunAsync(Func<ApplicationMetadata, IHostEnvironment, Task> func, string? sectionName) 76host.Services.GetRequiredService<IHostEnvironment>()); 80private static async Task RunAsync_HostBuilder(Func<ApplicationMetadata, IHostEnvironment, Task> func, string? sectionName) 103host.Services.GetRequiredService<IHostEnvironment>());
ApplicationMetadataExtensionsTests.cs (1)
24private readonly Mock<IHostEnvironment> _hostEnvironment = new();
ApplicationMetadataSourceTests.cs (1)
19private readonly Mock<IHostEnvironment> _hostEnvironment = new();
Microsoft.Extensions.Hosting (56)
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 (19)
24private readonly IHostEnvironment _environment; 41/// <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 '[<see cref="IHostEnvironment.ApplicationName"/>].settings.json' and '[<see cref="IHostEnvironment.ApplicationName"/>].settings.[<see cref="IHostEnvironment.EnvironmentName"/>].json' when <see cref="IHostEnvironment.ApplicationName"/> is not empty</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> 48/// <item><description>enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'</description></item> 62/// <item><description>set the <see cref="IHostEnvironment.ContentRootPath"/> to the result of <see cref="Directory.GetCurrentDirectory()"/></description></item> 65/// <item><description>load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json'</description></item> 66/// <item><description>load app <see cref="IConfiguration"/> from '[<see cref="IHostEnvironment.ApplicationName"/>].settings.json' and '[<see cref="IHostEnvironment.ApplicationName"/>].settings.[<see cref="IHostEnvironment.EnvironmentName"/>].json' when <see cref="IHostEnvironment.ApplicationName"/> is not empty</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 (9)
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 '[<see cref="IHostEnvironment.ApplicationName"/>].settings.json' and '[<see cref="IHostEnvironment.ApplicationName"/>].settings.[<see cref="IHostEnvironment.EnvironmentName"/>].json' when <see cref="IHostEnvironment.ApplicationName"/> is not empty 186/// * load app <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly 190/// * enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' 239IHostEnvironment 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; 37IHostEnvironment hostEnvironment, 583public 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);