10 implementations of EnvironmentName
Aspire.Dashboard.Tests (1)
BrowserSecurityHeadersMiddlewareTests.cs (1)
95public string EnvironmentName { get; set; } = "Development";
Aspire.Hosting.Azure.Tests (1)
ProvisioningTestHelpers.cs (1)
1027public string EnvironmentName { get; set; } = "Test";
Aspire.Hosting.Docker.Tests (1)
DockerComposePublisherTests.cs (1)
1590public string EnvironmentName { get; set; } = environmentName;
Aspire.Hosting.RemoteHost.Tests (1)
AtsExportsTests.cs (1)
186public string EnvironmentName { get; set; } = Environments.Production;
Aspire.Hosting.Tests (3)
Dashboard\DashboardServiceTests.cs (1)
1935public string EnvironmentName { get; set; } = default!;
Dcp\DcpExecutorTests.cs (1)
11861public string EnvironmentName { get; set; } = default!;
Publishing\DeploymentStateManagerTests.cs (1)
1346public string EnvironmentName { get; set; } = "Development";
Microsoft.AspNetCore.Components.WebAssembly (1)
Hosting\WebAssemblyHostEnvironmentAdapter.cs (1)
18public string EnvironmentName
Microsoft.AspNetCore.Hosting (1)
Internal\HostingEnvironment.cs (1)
14public string EnvironmentName { get; set; } = Extensions.Hosting.Environments.Production;
Microsoft.Extensions.Hosting (1)
Internal\HostingEnvironment.cs (1)
21public string EnvironmentName { get; set; } = string.Empty;
1 write to EnvironmentName
Microsoft.AspNetCore.Hosting (1)
Internal\HostingEnvironmentExtensions.cs (1)
106hostingEnvironment.EnvironmentName =
106 references to EnvironmentName
Aspire.Hosting (8)
DistributedApplicationBuilder.cs (2)
224var aspireSecretsFilePath = ResolveAspireSecretsFilePath(configuredAspireSecretsFile, userSecretsId, _innerBuilder.Environment.EnvironmentName); 1205var environment = _innerBuilder.Environment.EnvironmentName.ToLowerInvariant();
Pipelines\DistributedApplicationPipeline.cs (2)
73context.Logger.LogInformation("Initializing deployment for environment '{EnvironmentName}'", hostEnvironment.EnvironmentName); 92$"The deployment state for the '{hostEnvironment.EnvironmentName}' environment will be cleared. Do you want to continue?",
Pipelines\Internal\FileDeploymentStateManager.cs (4)
64var currentStatePath = GetStatePath(configuration, GetDeploymentStatePathSha(configuration), hostEnvironment.EnvironmentName); 72var legacyStatePath = GetStatePath(configuration, configuration["AppHost:LegacyDeploymentStatePathSha256"], hostEnvironment.EnvironmentName); 78private string? GetCanonicalStatePath() => GetStatePath(configuration, GetDeploymentStatePathSha(configuration), hostEnvironment.EnvironmentName); 80private string? GetLegacyStatePath() => GetStatePath(configuration, configuration["AppHost:LegacyDeploymentStatePathSha256"], hostEnvironment.EnvironmentName);
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.Blazor (2)
BlazorGatewayExtensions.cs (2)
57ConfigureGatewayToolForRunMode(gateway, builder.AppHostDirectory, builder.Environment.EnvironmentName); 116ConfigureGatewayToolForRunMode(gateway, builder.AppHostDirectory, builder.Environment.EnvironmentName);
Aspire.Hosting.Blazor.Tests (2)
AddBlazorGatewayTests.cs (2)
75arg => Assert.Equal(builder.Environment.EnvironmentName, arg), 553builder.Environment.EnvironmentName,
Aspire.Hosting.Docker (1)
DockerComposeEnvironmentResource.cs (1)
603var environmentName = hostEnvironment?.EnvironmentName ?? environment.Name;
Aspire.Hosting.JavaScript.Tests (2)
AddNodeAppTests.cs (2)
41"NODE_ENV": "{{builder.Environment.EnvironmentName.ToLowerInvariant()}}", 74"NODE_ENV": "{{builder.Environment.EnvironmentName.ToLowerInvariant()}}",
Aspire.Hosting.Kubernetes (1)
Deployment\HelmDeploymentEngine.cs (1)
60var releaseName = hostEnvironment.EnvironmentName.ToLowerInvariant();
Aspire.Hosting.Testing.Tests (3)
TestingBuilderTests.cs (3)
120Assert.Equal(testEnvironmentName, builder.Environment.EnvironmentName); 139Assert.Equal("Testing", builder.Environment.EnvironmentName); 146Assert.Equal(Environments.Development, builder.Environment.EnvironmentName);
Aspire.Hosting.Tests (16)
AspireEnvironmentTests.cs (8)
20Assert.Equal("Staging", builder.Environment.EnvironmentName); 32Assert.Equal("Production", builder.Environment.EnvironmentName); 44Assert.Equal("Production", builder.Environment.EnvironmentName); 56Assert.Equal("Testing", builder.Environment.EnvironmentName); 68Assert.Equal("Production", builder.Environment.EnvironmentName); 84Assert.Equal("Production", builder.Environment.EnvironmentName); 96Assert.Equal("Production", builder.Environment.EnvironmentName); 108Assert.Equal("Testing", builder.Environment.EnvironmentName);
DistributedApplicationBuilderTests.cs (4)
634Assert.Equal("Production", appBuilder.Environment.EnvironmentName); 672Assert.Equal(environment, appBuilder.Environment.EnvironmentName); 697Assert.Equal(environment, appBuilder.Environment.EnvironmentName); 1196Assert.Equal("Invalid.Env", builder.Environment.EnvironmentName);
PublishAsDockerfileTests.cs (4)
40"NODE_ENV": "{{builder.Environment.EnvironmentName.ToLowerInvariant()}}" 93"NODE_ENV": "{{builder.Environment.EnvironmentName.ToLowerInvariant()}}" 138"NODE_ENV": "{{builder.Environment.EnvironmentName.ToLowerInvariant()}}" 200"NODE_ENV": "{{builder.Environment.EnvironmentName.ToLowerInvariant()}}"
Aspire.Hosting.Yarp (1)
YarpResourceExtensions.cs (1)
42.WithEnvironment("ASPNETCORE_ENVIRONMENT", builder.Environment.EnvironmentName)
blazor-devserver (1)
Server\Startup.cs (1)
46ctx.Response.Headers.Append("Blazor-Environment", webHostEnvironment.EnvironmentName);
Microsoft.AspNetCore (9)
WebApplicationBuilder.cs (1)
299.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: reloadOnChange);
WebHost.cs (8)
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, 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, 179.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); 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 (1)
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
450config.InteractiveWebAssembly.EnvironmentName ??= hostEnvironment.EnvironmentName;
Microsoft.AspNetCore.Components.Web (1)
EnvironmentView.cs (1)
79var currentEnvironmentName = HostEnvironment.EnvironmentName?.Trim();
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
ComponentsWebAssemblyApplicationBuilderExtensions.cs (1)
48context.Response.Headers.Append("Blazor-Environment", webHostEnvironment.EnvironmentName);
Microsoft.AspNetCore.Hosting (12)
GenericHost\GenericWebHostBuilder.cs (5)
102var startupType = StartupLoader.FindStartupType(webHostOptions.StartupAssembly!, webhostContext.HostingEnvironment.EnvironmentName); 234if (StartupLoader.HasConfigureServicesIServiceProviderDelegate(startupType, context.HostingEnvironment.EnvironmentName)) 243var configureServicesBuilder = StartupLoader.FindConfigureServicesDelegate(startupType, context.HostingEnvironment.EnvironmentName); 250var configureContainerBuilder = StartupLoader.FindConfigureContainerDelegate(startupType, context.HostingEnvironment.EnvironmentName); 260configureBuilder = StartupLoader.FindConfigureDelegate(startupType, context.HostingEnvironment.EnvironmentName);
Internal\HostingEnvironmentExtensions.cs (2)
107baseEnvironment?.EnvironmentName ?? 109hostingEnvironment.EnvironmentName;
Internal\WebHostOptions.cs (1)
24Environment = environment?.EnvironmentName ?? GetConfig(WebHostDefaults.EnvironmentKey);
WebHostBuilder.cs (1)
334var methods = StartupLoader.LoadMethods(serviceProvider, startupType, hostingEnvironment.EnvironmentName);
WebHostBuilderExtensions.cs (2)
122return new ConventionBasedStartup(StartupLoader.LoadMethods(serviceProvider, instance.GetType(), hostingEnvironment.EnvironmentName, instance)); 159return new ConventionBasedStartup(StartupLoader.LoadMethods(sp, startupType, hostingEnvironment.EnvironmentName));
WebHostExtensions.cs (1)
119Console.WriteLine($"Hosting environment: {hostingEnvironment?.EnvironmentName}");
Microsoft.AspNetCore.Mvc.TagHelpers (1)
EnvironmentTagHelper.cs (1)
81var currentEnvironmentName = HostingEnvironment.EnvironmentName?.Trim();
Microsoft.Extensions.AmbientMetadata.Application (1)
ApplicationMetadataSource.cs (1)
46{ $"{SectionName}:{nameof(ApplicationMetadata.EnvironmentName)}", _hostEnvironment.EnvironmentName },
Microsoft.Extensions.AmbientMetadata.Application.Tests (4)
AcceptanceTests.cs (2)
36options.EnvironmentName.Should().Be(hostEnvironment.EnvironmentName); 52options.EnvironmentName.Should().Be(hostEnvironment.EnvironmentName);
ApplicationMetadataExtensionsTests.cs (1)
28_hostEnvironment.Setup(h => h.EnvironmentName).Returns(TestEnvironmentName);
ApplicationMetadataSourceTests.cs (1)
24_hostEnvironment.Setup(h => h.EnvironmentName).Returns(TestEnvironmentName);
Microsoft.Extensions.Hosting (30)
Host.cs (12)
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> 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> 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> 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 (8)
43/// <item>load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json'</item> 44/// <item>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</item> 45/// <item>load app <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly</item> 48/// <item>enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'</item> 65/// <item>load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json'</item> 66/// <item>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</item> 67/// <item>load app <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly</item> 71/// <item>enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'</item>
HostApplicationBuilderSettings.cs (3)
34/// <item>load <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json'</item> 35/// <item>load <see cref="IConfiguration"/> from User Secrets when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development' using the entry assembly</item> 39/// <item>enables scope validation on the dependency injection container when <see cref="IHostEnvironment.EnvironmentName"/> is 'Development'</item>
HostingHostBuilderExtensions.cs (6)
183/// * load app <see cref="IConfiguration"/> from 'appsettings.json' and 'appsettings.[<see cref="IHostEnvironment.EnvironmentName"/>].json' 184/// * 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 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' 237.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: reloadOnChange); 244.AddJsonFile($"{sanitizedApplicationName}.settings.{env.EnvironmentName}.json", optional: true, reloadOnChange: reloadOnChange);
Internal\ConsoleLifetime.cs (1)
105Logger.LogInformation("Hosting environment: {EnvName}", Environment.EnvironmentName);
Microsoft.Extensions.Hosting.Abstractions (2)
HostDefaults.cs (1)
17/// The configuration key used to set <see cref="IHostEnvironment.EnvironmentName"/>.
HostEnvironmentEnvExtensions.cs (1)
62hostEnvironment.EnvironmentName,
Microsoft.Extensions.Hosting.Systemd (1)
SystemdLifetime.cs (1)
98Environment.EnvironmentName, Environment.ContentRootPath);
Microsoft.Extensions.Hosting.WindowsServices (1)
WindowsServiceLifetime.cs (1)
83Environment.EnvironmentName, Environment.ContentRootPath);
Microsoft.Extensions.Telemetry.Tests (2)
Enrichment\ApplicationLogEnricherTests.cs (2)
26_hostMock.SetupGet(c => c.EnvironmentName).Returns(EnvironmentName); 71EnvironmentName = _hostMock.Object.EnvironmentName