26 references to EnvironmentKey
blazor-devserver (1)
Server\Program.cs (1)
34[WebHostDefaults.EnvironmentKey] = "Development",
Microsoft.AspNetCore (5)
ConfigureWebHostBuilder.cs (5)
44var previousEnvironment = _configuration[WebHostDefaults.EnvironmentKey]; 68else if (!string.Equals(previousEnvironment, _configuration[WebHostDefaults.EnvironmentKey], StringComparison.OrdinalIgnoreCase)) 71throw new NotSupportedException($"The environment changed from \"{previousEnvironment}\" to \"{_configuration[WebHostDefaults.EnvironmentKey]}\". Changing the host configuration using WebApplicationBuilder.WebHost is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead."); 119var previousEnvironment = _configuration[WebHostDefaults.EnvironmentKey]; 141else if (string.Equals(key, WebHostDefaults.EnvironmentKey, StringComparison.OrdinalIgnoreCase) &&
Microsoft.AspNetCore.Hosting (3)
Internal\WebHostOptions.cs (1)
24Environment = environment?.EnvironmentName ?? GetConfig(WebHostDefaults.EnvironmentKey);
WebHostBuilder.cs (2)
45if (string.IsNullOrEmpty(GetSetting(WebHostDefaults.EnvironmentKey))) 48UseSetting(WebHostDefaults.EnvironmentKey, Environment.GetEnvironmentVariable("Hosting:Environment")
Microsoft.AspNetCore.Hosting.Abstractions (1)
HostingAbstractionsWebHostBuilderExtensions.cs (1)
90return hostBuilder.UseSetting(WebHostDefaults.EnvironmentKey, environment);
Microsoft.AspNetCore.Hosting.Tests (10)
HostingEnvironmentExtensionsTests.cs (1)
68[WebHostDefaults.EnvironmentKey] = "NewName"
WebHostBuilderTests.cs (8)
491.UseSetting(WebHostDefaults.EnvironmentKey, "EnvA") 492.UseSetting(WebHostDefaults.EnvironmentKey, "EnvB") 509{ WebHostDefaults.EnvironmentKey, "EnvB" } 517.UseSetting(WebHostDefaults.EnvironmentKey, "EnvA") 535{ WebHostDefaults.EnvironmentKey, "EnvA" } 544.UseSetting(WebHostDefaults.EnvironmentKey, "EnvB") 561{ WebHostDefaults.EnvironmentKey, "EnvA" } 570{ WebHostDefaults.EnvironmentKey, "EnvB" }
WebHostConfigurationsTests.cs (1)
19{ WebHostDefaults.EnvironmentKey, Environments.Development},
Microsoft.AspNetCore.Tests (5)
WebApplicationTests.cs (5)
394Assert.Throws<NotSupportedException>(() => builder.WebHost.UseSetting(WebHostDefaults.EnvironmentKey, envName)); 425{ WebHostDefaults.EnvironmentKey, envName } 843$"--{WebHostDefaults.EnvironmentKey}=Test" 892$"--{WebHostDefaults.EnvironmentKey}={envName}", 2251builder.Configuration[WebHostDefaults.EnvironmentKey] = envName;
Wasm.Performance.Driver (1)
src\Components\WebAssembly\DevServer\src\Server\Program.cs (1)
34[WebHostDefaults.EnvironmentKey] = "Development",