title: Save appsettings.json in .net core 3.1
body: <p>I want a configuration file in my .net core 3.1 winforms project.
  I have the following working to read the file</p>
  
  <pre><code>using Microsoft.Extensions.Configuration;
  using System;
  using System.Text;
  using System.Windows.Forms;
  using System.Xml;
  namespace FeedRead
  {
  
      public partial class Form1 : Form
      {
  
          private ConfigurationBuilder configuration;
          public Form1()
          {
              configuration = new ConfigurationBuilder();
              configuration.SetBasePath(System.IO.Directory.GetCurrentDirectory());
              configuration.AddJsonFile(path: "appsettings.json", optional: false, reloadOnChange: true);
              configuration.Build();
          }
  </code></pre>
  
  <p>but how do I save the configuration when I have made changes?</p>
  
  <p>I tried the following but don't know how to complete it.</p>
  
  <pre><code>    private void Form1_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
      {
  
          configuration.Properties.Add("col1Width", listView1.Columns[0].Width);
          var extn = configuration as Microsoft.Extensions.Configuration.IConfigurationBuilder; // not sure about
          var provider = extn.GetFileProvider();
          var info = provider.GetFileInfo(subpath: "appsettings.json"); // not sure about
          // how do i save?
  
      }
  </code></pre>