title: About path in appsettings.json in C#
body: <p>I have a question concerning getting path from appsettings.json:</p>
  <p>In appsettings.json:</p>
  <pre><code>&quot;VirtualPathConfig&quot;: [
  {
    &quot;Realpath&quot;: &quot;../api_website_data/images&quot;,
    &quot;RequestPath&quot;: &quot;/images&quot;,
    &quot;Alias&quot;: &quot;images&quot;
  },
  {
    &quot;Realpath&quot;: &quot;../api_website_data/document&quot;,
    &quot;RequestPath&quot;: &quot;/document&quot;,
    &quot;Alias&quot;: &quot;document&quot;
  }
  ]
  </code></pre>
  <p>In my startup.cs</p>
  <pre><code> var vitualPath = 
  Configuration.GetSection(nameof(VirtualPathConfig)).Get&lt;List&lt;VirtualPathConfig&gt;&gt;();
    vitualPath.ForEach(f =&gt;
    {
        app.UseStaticFiles(new StaticFileOptions()
        {
            FileProvider = new PhysicalFileProvider(f.RealPath),
            RequestPath = f.RequestPath
        });
    });
  </code></pre>
  <p>In model:</p>
  <pre><code>namespace ApiWebsite.Model
  {
    public class VirtualPathConfig
    {
     public string RealPath { get; set; }
     public string RequestPath { get; set; }
     public string Alias { get; set; }
    }
   }
  </code></pre>
  <p>folder structure:
  <a href="https://i.stack.imgur.com/Ol9un.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ol9un.png" alt="enter image description here" /></a></p>
  <p>My question is, why can't I get the realpath out? It said Not Found!
  Please, can someone give me some instructions?</p>