10 references to EnvironmentKey
Microsoft.AspNetCore (3)
ConfigureHostBuilder.cs (3)
68
var previousEnvironment = _configuration[HostDefaults.
EnvironmentKey
];
86
if (!string.Equals(previousEnvironment, _configuration[HostDefaults.
EnvironmentKey
], StringComparison.OrdinalIgnoreCase))
88
throw 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)
152
optionList.Add(new KeyValuePair<string, string?>(HostDefaults.
EnvironmentKey
, settings.EnvironmentName));
277
string? previousEnvironment = config[HostDefaults.
EnvironmentKey
];
292
if (!string.Equals(previousEnvironment, config[HostDefaults.
EnvironmentKey
], StringComparison.OrdinalIgnoreCase))
294
throw new NotSupportedException(SR.Format(SR.EnvironmentNameChangeNotSupoprted, previousEnvironment, config[HostDefaults.
EnvironmentKey
]));
HostBuilder.cs (1)
231
EnvironmentName = hostConfiguration[HostDefaults.
EnvironmentKey
] ?? Environments.Production,
HostingHostBuilderExtensions.cs (1)
42
new KeyValuePair<string, string?>(HostDefaults.
EnvironmentKey
, environment)