MinimalAPI configuration reload do not update the the options value #34056
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
feature-minimal-hosting
Milestone
Describe the bug
When I use the MinimalAPI, I met an issue that the value of the options could not get updated when I try to reload the configuration via
IConfigurationRoot.Reload()
, I'm not sure if this is by design.Sample code is as below:
When I access the
redeploy
endpoint, the value of the option should be updated I think.More
After some research, I found that the
builder.Configuration
andIConfiguration
from DI are not the same instance, so when I callreload
, the option's value did not update, maybe this is by design? I'm not sure so I created this issue.To Reproduce
There's a simple sample for reproducing the issue, https://github.com/WeihanLi/AspNetCorePlayground/tree/master/MinimalAPIConfigurationIssue
dotnet run
Expected behavior:
The
setting1
value from the response should beSlot2
Actucal behavior:
The
setting1
value from the response keep asnull
Further technical details
dotnet --info
The text was updated successfully, but these errors were encountered: