title: DotNet Controller to Return Static File
body: <p>I am trying to tell the controller to return a static file in some condition. I tried many ways "Server.MapPath" doesn't work for me so i need an alternative. i tried following but i get an error:</p>
  
  <pre><code>return File(Url.Content(startupPath), "text/javascript");
  </code></pre>
  
  <p>the error is:</p>
  
  <pre><code>InvalidOperationException: No file provider has been configured to process the supplied file.
  Microsoft.AspNetCore.Mvc.Infrastructure.VirtualFileResultExecutor.GetFileInformation(VirtualFileResult result)
  </code></pre>
  
  <p>I have  app.UseStaticFiles() and app.UseSpaStaticFiles(); both set.</p>