title: Change configuration file in ASP.NET Core
body: <p>I am trying to create a self-contained .NET Core Console Application.
  In my application, I have added a configuration file appsettings.json .
  The goal is now that I need to have the possibility to modify the configuration file while the application is running (and published)</p>
  
  <p>I have found several guides but they all point to the direction where I need to include the following function:</p>
  
  <pre><code>        public void ConfigureServices(IServiceCollection services)
      {
          // Adds services required for using options.
          services.AddOptions();
  
          // Register the IConfiguration instance which MyOptions binds against.
          services.Configure&lt;DBSetting&gt;(Configuration);
  
          // Add framework services.
          services.AddMvc();
      }
  </code></pre>
  
  <p>But when I do this all the methodes of services are red. If I look u IserviceCollection the doc says that it has become obsolete.
  I did add </p>
  
  <pre><code>            var builder = new ConfigurationBuilder()
              .AddJsonFile(@"C:\Users\Maarten\Documents\Visual Studio 2015\Projects\CorporationBot\CorporationBotCore\appsettings.json", optional: true, reloadOnChange:true);                
          Configuration = builder.Build();
  </code></pre>
  
  <p>in my Program.cs which lets me fetch the data in my config file.
  Now I need a way to change my config while the application is running.
  Any up to date ways to do it?</p>