ASP.Net Core live update configuration on strongly typed
<p>I was trying out ASP.Net Core and I and i was fooling around with the new configuration implementation. I created my configuration like this:</p>

<pre><code>public Startup(IHostingEnvironment env)
{
     var builder = new ConfigurationBuilder()
        .SetBasePath(env.ContentRootPath)
        .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
        .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true)
        .AddEnvironmentVariables()
        .AddUserSecrets();

    ConfigurationManager.SetConfiguration(builder.Build());
}
</code></pre>

<p>I have my own ConfigurationManager class which basically holds the IConfigurationRoot and i have some helper methods in it.</p>

<pre><code>public static class ConfigurationManager
{
    private static IConfigurationRoot _configuration { get; set; }

    public static IConfigurationRoot GetConfiguration()
    {
        return _configuration;
    }

    public static void SetConfiguration(IConfigurationRoot configuration)
    {
        _configuration = configuration;
    }

    public static string GetString(string appSettingKey)
    {
        return _configuration.GetValue&lt;string&gt;(appSettingKey);
    }

    public static IConfigurationSection GetSection(string sectionKey)
    {
        return _configuration.GetSection(sectionKey);
    }
}
</code></pre>

<p>I can access my 'Foo' setting like this:</p>

<pre><code>var foo = ConfigurationManager.GetString("Foo");
</code></pre>

<p>When I run my application the code above will give me the value of 'Foo', which is "Bar". If I change the value of 'Foo' in my applicationsettings.json from "Bar" to "BarBar" while my application is still running and come across the code above it will give me the new value of 'Foo'.</p>

<p>I have created a Configuration class so I can have my settings as strongly typed.</p>

<pre><code>public class Configuration
{
    public string Foo { get; set; }
}
</code></pre>

<p>I Bind it to my configuration like this:</p>

<pre><code>services.Configure&lt;Configuration&gt;(ConfigurationManager.GetConfiguration());
</code></pre>

<p>I can acces the 'Foo' setting through dependency injection in my controller like this:</p>

<pre><code>public MyController(IOptions&lt;Configuration&gt; config)
{
    var foo = config.Value.Foo;
}
</code></pre>

<p>When I call the controller the value of 'Foo' is "Bar". When I change the value of 'Foo' into "BarBar" and call the controller again the value of 'Foo' is still "Bar" in my strongly typed configuration.</p>

<p>Is there a way to make the strongly typed class change when I change my applicationsettings.json on the fly as it does when I don't use the strongly typed class?</p>