diff --git a/src/NLog.Web.AspNetCore/Config/SetupBuilderExtensions.cs b/src/NLog.Web.AspNetCore/Config/SetupBuilderExtensions.cs index 09c6f6bd..b25a6d85 100644 --- a/src/NLog.Web.AspNetCore/Config/SetupBuilderExtensions.cs +++ b/src/NLog.Web.AspNetCore/Config/SetupBuilderExtensions.cs @@ -20,7 +20,7 @@ public static class SetupBuilderExtensions /// public static ISetupBuilder LoadConfigurationFromAppSettings(this ISetupBuilder setupBuilder, string basePath = null, string environment = null, string nlogConfigSection = "NLog", bool optional = true, bool reloadOnChange = false) { - environment = environment ?? GetAspNetCoreEnvironment("DOTNET_ENVIRONMENT") ?? GetAspNetCoreEnvironment("ASPNETCORE_ENVIRONMENT") ?? "Production"; + environment = environment ?? GetAspNetCoreEnvironment("ASPNETCORE_ENVIRONMENT") ?? GetAspNetCoreEnvironment("DOTNET_ENVIRONMENT") ?? "Production"; var builder = new ConfigurationBuilder() // Host Configuration