-
Notifications
You must be signed in to change notification settings - Fork 312
appsettings does not get reloaded when using UseConfiguration extension method #1430
Comments
That's expected. UseConfiguration copies all of the keys: Hosting/src/Microsoft.AspNetCore.Hosting.Abstractions/HostingAbstractionsWebHostBuilderExtensions.cs Lines 24 to 32 in a63932a
It would be nice to change this behavior in 3.0. |
Is there documentation on the difference between host and application configuration? While I like the changes that took place with 2.0, it kind of muddied the waters when figuring out configuration. And this: public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build(); hides a lot of the magic. It's not clear on if I can override settings by just adding It seems that there are now at least two configurations, a Host |
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/web-host?view=aspnetcore-2.1&tabs=aspnetcore2x is the doc where this should go. Please comment there. |
This comment has been minimized.
This comment has been minimized.
That is not related to hosting or this issue. Please open a new issue against configuration. |
There's not a good way to fix UseConfiguration since it's an extension method on IWebHostBuilder which only has GetSetting and UseSetting and we're trying to avoid breaking the interface. This isn't an issue going forward because generic host has ConfigureHostConfiguration with first class config support. |
The
appsettings.json
file is never reloaded on change when using theUseConfiguration
extension method.Using the
ConfigureAppConfiguration
extension method however does cause theappsettings.json
file to be reloaded on change.I've created a sample project that uses a feature toggle to optionally print "Hello World" on the home page.
Example project: https://github.com/BennieCopeland/AppSettingBug
The text was updated successfully, but these errors were encountered: