-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Fix WebApplicationBuilder to read environment specific config for logging #32822
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
Conversation
f3d8942
to
693b4c2
Compare
bootstrapBuilder.ConfigureWebHostDefaults(configure: _ => { }); | ||
bootstrapBuilder.ConfigureDefaults(args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flipping the order of configuring WebHostDefaults was important for ensuring that the right appsettings.{Env}.json gets loaded initially when ASPNETCORE_ENVIRONMENT
is configured. I don't know of any negative consequences of flipping the default configuration order for the BootstrapHostBuilder, but that doesn't mean there aren't any.
Before
After
CreateDefaultBuilder/ConfigureWebHostDefaults
Fixes #32383
Thanks to @KevinCathcart for dotnet/runtime#51770 (comment)
TODO: Add tests