Skip to content

IOptionsSnapshot is not working with non API/Web scenarios #3153

@cilerler

Description

@cilerler

It looks like IOptionsSnapshot with reloadOnChange: true set on HostBuilder is not updating the options value when the appsettings.json content changes.

This behavior works fine on WebHost. As far as my understanding IOptionsSnapshot gets generated as Scoped in WebHost for each call. However this doesn't apply to HostBuilder since there is no outside caller exist.

We should be able to detect setting changes and I would like you to consider this issue as a feature request.

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: By DesignResolved because the behavior in this issue is the intended design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions