title: ASP.NET Core 3.1 WebRoot Path
body: <p>I am pushing an external file into the wwwroot folder of my ASP.NET Core 3.1 application. I need to reference the path to provide a constructor variable during the services wire up.</p>
  
  <p>In the Startup class I have added the IWebHostEnvironment to the constructor parameters:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public Startup(IConfiguration configuration, IWebHostEnvironment env)
  {
    Configuration = configuration;
    _env = env;
  }
  </code></pre>
  
  <p>When debugging, it seems that <code>_env.WebRootPath</code> returns the path as it is in my source folder, rather than the path being executed, i.e.</p>
  
  <p>It returns:
  <code>&lt;path to my source code&gt;/wwwroot</code></p>
  
  <p>Instead of the execution relative path:
  <code>&lt;path to my source code&gt;/bin/Debug/netcoreapp3.0/wwwroot</code></p>
  
  <p>How do i get it to return the correct, execution relative path?</p>