You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The .Net agent only uses the appsettings.{environment}.json if either the ASPNETCORE_ENVIRONMENT or the NewRelic custom EnvironmentName environment variable is set. This is in contrast to the default .NET environment behaviour where if nothing is set in the environment variables, the IHostEnvironment.EnvironmentName is by default set to Production
Production: The default if DOTNET_ENVIRONMENT and ASPNETCORE_ENVIRONMENT have not been set.
As such, the below code should act the same and thus should add another
if (string.IsNullOrEmpty(environment))
{
environment = Environments.Production; // Microsoft.Extensions.Hosting
}
The .Net agent only uses the
appsettings.{environment}.json
if either theASPNETCORE_ENVIRONMENT
or the NewRelic customEnvironmentName
environment variable is set. This is in contrast to the default .NET environment behaviour where if nothing is set in the environment variables, theIHostEnvironment.EnvironmentName
is by default set toProduction
As such, the below code should act the same and thus should add another
https://github.com/newrelic/newrelic-dotnet-agent/blob/f8dcf184dd98c18601b34c7fc186f7d83d1b90fb/src/Agent/NewRelic/Agent/Core/Configuration/AppSettingsConfigResolveWhenUsed.cs#L52C1-L52C1
The text was updated successfully, but these errors were encountered: