25 references to EnvironmentKey
blazor-devserver (1)
Server\Program.cs (1)
36
[WebHostDefaults.
EnvironmentKey
] = "Development",
Microsoft.AspNetCore (5)
ConfigureWebHostBuilder.cs (5)
44
var previousEnvironment = _configuration[WebHostDefaults.
EnvironmentKey
];
68
else if (!string.Equals(previousEnvironment, _configuration[WebHostDefaults.
EnvironmentKey
], StringComparison.OrdinalIgnoreCase))
71
throw 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.");
119
var previousEnvironment = _configuration[WebHostDefaults.
EnvironmentKey
];
141
else if (string.Equals(key, WebHostDefaults.
EnvironmentKey
, StringComparison.OrdinalIgnoreCase) &&
Microsoft.AspNetCore.Hosting (3)
Internal\WebHostOptions.cs (1)
24
Environment = environment?.EnvironmentName ?? GetConfig(WebHostDefaults.
EnvironmentKey
);
WebHostBuilder.cs (2)
45
if (string.IsNullOrEmpty(GetSetting(WebHostDefaults.
EnvironmentKey
)))
48
UseSetting(WebHostDefaults.
EnvironmentKey
, Environment.GetEnvironmentVariable("Hosting:Environment")
Microsoft.AspNetCore.Hosting.Abstractions (1)
HostingAbstractionsWebHostBuilderExtensions.cs (1)
90
return 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)
394
Assert.Throws<NotSupportedException>(() => builder.WebHost.UseSetting(WebHostDefaults.
EnvironmentKey
, envName));
425
{ WebHostDefaults.
EnvironmentKey
, envName }
843
$"--{WebHostDefaults.
EnvironmentKey
}=Test"
892
$"--{WebHostDefaults.
EnvironmentKey
}={envName}",
2251
builder.Configuration[WebHostDefaults.
EnvironmentKey
] = envName;