Skip to content

Conversation

@davidfowl
Copy link
Member

@davidfowl davidfowl commented Sep 7, 2021

Backport of #36186 to release/6.0

Customer Impact

This bug prevents inconsistent state being observed by various stages of the WebApplicationBuilder and also allows manual configuration reload to work.

Testing

Unit testing and manual testing.

Risk

Low.

- The new WebApplicationBuilder merged host configuration and application configuration together into the same configuration source, then applied those changes to the final all as host configuration. This had some bad side effects:
  - All configuration changes are wrapped in a chained configuration source which prevented updates (that's a runtime bug)
 - Host configuration could be mutated by changing any value directly in configuration. This meant that different parts of the code base could see a different environment, application name and content root.
This change fixes things by snapshotting the immutable host configuration in the constructor and applying it later. Then only applying configuration sources to application configuration, not host configuration.
- Added tests
@davidfowl
Copy link
Member Author

cc @dotnet/aspnet-build for merge

@wtgodbe wtgodbe enabled auto-merge (squash) September 7, 2021 17:17
@wtgodbe wtgodbe merged commit d284f15 into release/6.0 Sep 7, 2021
@wtgodbe wtgodbe deleted the davidfowl/backport-36186 branch September 7, 2021 18:13
@amcasey amcasey added area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed area-runtime labels Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc feature-minimal-hosting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants