The Wayback Machine - https://web.archive.org/web/20210527175027/https://github.com/dotnet/aspnetcore/issues/33082
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

Use a ChainedConfigurationSource to share sources between WebApplicationBuilder an inner host #33082

Open
halter73 opened this issue May 27, 2021 · 0 comments

Comments

@halter73
Copy link
Member

@halter73 halter73 commented May 27, 2021

WebApplicationBuilder currently copies sources from its Configuration property in a _hostBuilder.ConfigureHostConfiguration( callback. This works well for sources that are configured by that point, but that means lower-level services like loggers that use the _hostBuilder's configuration don't observe sources that are added are removed after the ConfigureHostConfiguration runs.

As part of this, I think we should try to re-add app configuration during WebApplicationBuilder.Build() so we can allow users to change the environment after constructing the WebApplicationBuilder but before actually building it. See WebApplicationFunctionalTests.EnvironmentSpecificLoggingConfigurationSectionPassedToLoggerByDefault() for one of the broken scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant