title: .Netcore 2.0 and Virtual Directory
body: <p>I have a .netcore 2.0 project running on IIS windows 2012.</p>
  
  <p>There is an issue as I can't seem to get virtual directories working that exist outside of the root of the application. This works fine when the files are in the solution:</p>
  
  <pre><code>app.UseStaticFiles(new StaticFileOptions()
  {
      FileProvider = new PhysicalFileProvider(
      Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot", "images")),
      RequestPath = new PathString("/MyImages")
  });
  </code></pre>
  
  <p>The below does not however when outside of the root folder - </p>
  
  <pre><code>app.UseDirectoryBrowser(new DirectoryBrowserOptions()
  {
      FileProvider = new PhysicalFileProvider(Configuration["Keys:UploadFolder"]),
      RequestPath = new PathString("/upload")
  });
  </code></pre>
  
  <p>The reason for doing this is I have setup CI with octopus deploy. Each time I do a deployment the uploaded files are no longer there without using a virtual directory or creating some powershell script in octopus to copy them all over from last deployment.</p>
  
  <p>Any recommendations or ways of resolving this in IIS with virtual directories in .netcore 2.0?</p>