Why is not injected last version of configuration (appsettings.json)?
问题 I am trying to edit appsettings.json in runtime. I found great solution how to update this file: https://stackoverflow.com/a/45986656/9684060 I did everything according to answer above: 1) Added MySettings to DI container ( MySettings are added via AddTransient ) services.ConfigureWritable(Configuration.GetSection(nameof(MySettings))); 2) Constructor injection private readonly IWritableOptions<MySettings> _cfg; public MyController(IWritableOptions<MySettings> cfg) { _cfg = cfg; } Then I use