25 references to EnvironmentKey
blazor-devserver (1)
Server\Program.cs (1)
36[WebHostDefaults.EnvironmentKey] = "Development",
Microsoft.AspNetCore (5)
ConfigureWebHostBuilder.cs (5)
46var previousEnvironment = _configuration[WebHostDefaults.EnvironmentKey]; 70else if (!string.Equals(previousEnvironment, _configuration[WebHostDefaults.EnvironmentKey], StringComparison.OrdinalIgnoreCase)) 73throw 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."); 121var previousEnvironment = _configuration[WebHostDefaults.EnvironmentKey]; 143else 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)
46if (string.IsNullOrEmpty(GetSetting(WebHostDefaults.EnvironmentKey))) 49UseSetting(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)
495.UseSetting(WebHostDefaults.EnvironmentKey, "EnvA") 496.UseSetting(WebHostDefaults.EnvironmentKey, "EnvB") 513{ WebHostDefaults.EnvironmentKey, "EnvB" } 521.UseSetting(WebHostDefaults.EnvironmentKey, "EnvA") 539{ WebHostDefaults.EnvironmentKey, "EnvA" } 548.UseSetting(WebHostDefaults.EnvironmentKey, "EnvB") 565{ WebHostDefaults.EnvironmentKey, "EnvA" } 574{ WebHostDefaults.EnvironmentKey, "EnvB" }
WebHostConfigurationsTests.cs (1)
19{ WebHostDefaults.EnvironmentKey, Environments.Development},
Microsoft.AspNetCore.Tests (5)
WebApplicationTests.cs (5)
396Assert.Throws<NotSupportedException>(() => builder.WebHost.UseSetting(WebHostDefaults.EnvironmentKey, envName)); 427{ WebHostDefaults.EnvironmentKey, envName } 845$"--{WebHostDefaults.EnvironmentKey}=Test" 894$"--{WebHostDefaults.EnvironmentKey}={envName}", 2253builder.Configuration[WebHostDefaults.EnvironmentKey] = envName;