Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

appsettings.Production.json is not used when using IIS #2081

Closed
rlarno opened this issue Nov 17, 2023 · 2 comments · Fixed by #2125
Closed

appsettings.Production.json is not used when using IIS #2081

rlarno opened this issue Nov 17, 2023 · 2 comments · Fixed by #2125
Labels
community To tag external issues and PRs

Comments

@rlarno
Copy link

rlarno commented Nov 17, 2023

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
            }

https://github.com/newrelic/newrelic-dotnet-agent/blob/f8dcf184dd98c18601b34c7fc186f7d83d1b90fb/src/Agent/NewRelic/Agent/Core/Configuration/AppSettingsConfigResolveWhenUsed.cs#L52C1-L52C1

@workato-integration
Copy link

@github-actions github-actions bot added the community To tag external issues and PRs label Nov 17, 2023
@tippmar-nr
Copy link
Member

@rlarno Thanks for your report. We are reviewing the information you've provided and will get this issue on our backlog soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community To tag external issues and PRs
Projects
None yet
2 participants