Skip to content

Conversation

@davidfowl
Copy link
Member

  • When making the internal host builder, we copy the sources from the ConfigurationManager to the internal IConfigurationBuilder and the HostBuilder creates. This results in building configuration twice which can be problematic for performance reasons. Instead, we copy over the already built configuration providers in a custom IConfigurationSource implementation. This change does means the looking at the list of sources will not match the original list of sources though.
  • Added a test

Fixes #36452

- When making the internal host builder, we copy the sources from the ConfigurationManager to the internal IConfigurationBuilder and the HostBuilder creates. This results in building configuration twice which can be problematic for performance reasons. Instead, we copy over the already built configuration providers in a custom IConfigurationSource implementation. This change does means the looking at the list of sources will not match the original list of sources though.
- Added a test
@ghost ghost added the area-runtime label Sep 15, 2021
@davidfowl davidfowl requested a review from a team September 15, 2021 19:18
@davidfowl davidfowl merged commit 3ae4729 into main Sep 15, 2021
@davidfowl davidfowl deleted the davidfowl/fix-double-config-build branch September 15, 2021 21:09
@ghost ghost added this to the 7.0-preview1 milestone Sep 15, 2021
@davidfowl
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

@monksoul
Copy link

Thank you.

I used the latest version of .NET6 daily build 6.0.0-rtm.21466.19 to test today, and the results were triggered many times. Will this repair result be released in the official version of .NET6? Or is it released in .NET7.

@ghost
Copy link

ghost commented Sep 17, 2021

Hi @monksoul. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

@davidfowl
Copy link
Member Author

Try the rc2 build today, not the rtm one. The fixes should be in now

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞 The WebApplicationBuilder.Configuration add custom configuration provider was called more than once.

7 participants