10 references to EnvironmentKey
Microsoft.AspNetCore (3)
ConfigureHostBuilder.cs (3)
68var previousEnvironment = _configuration[HostDefaults.EnvironmentKey]; 86if (!string.Equals(previousEnvironment, _configuration[HostDefaults.EnvironmentKey], StringComparison.OrdinalIgnoreCase)) 88throw new NotSupportedException($"The environment changed from \"{previousEnvironment}\" to \"{_configuration[HostDefaults.EnvironmentKey]}\". Changing the host configuration using WebApplicationBuilder.Host is not supported. Use WebApplication.CreateBuilder(WebApplicationOptions) instead.");
Microsoft.AspNetCore.Tests (1)
WebApplicationTests.cs (1)
1231{ HostDefaults.EnvironmentKey, "environmentName" },
Microsoft.Extensions.Hosting (6)
HostApplicationBuilder.cs (4)
152optionList.Add(new KeyValuePair<string, string?>(HostDefaults.EnvironmentKey, settings.EnvironmentName)); 277string? previousEnvironment = config[HostDefaults.EnvironmentKey]; 292if (!string.Equals(previousEnvironment, config[HostDefaults.EnvironmentKey], StringComparison.OrdinalIgnoreCase)) 294throw new NotSupportedException(SR.Format(SR.EnvironmentNameChangeNotSupoprted, previousEnvironment, config[HostDefaults.EnvironmentKey]));
HostBuilder.cs (1)
231EnvironmentName = hostConfiguration[HostDefaults.EnvironmentKey] ?? Environments.Production,
HostingHostBuilderExtensions.cs (1)
42new KeyValuePair<string, string?>(HostDefaults.EnvironmentKey, environment)