title: UNC path is invalid when starting ASP.NET Core Application in IIS
body: <p>I have a shared drive on my local network \hostname\shared\resource. I have mounted the drive programattically from within the Asp.net core web application in the startup.cs file.</p>
  
  <pre><code>app.UseStaticFiles();
  
  app.UseFileServer(new FileServerOptions{
      FileProvider = new 
      PhysicalFileProvider(@"\\TS3410D618\NickFlicks\Movies"),
      RequestPath = new PathString("/Movies"),
      EnableDirectoryBrowsing = false
  });
  </code></pre>
  
  <p>This works perfectly when I run it with IIS express(debugging), however, when I deploy it to my local IIS on the same machine the application fails to start with the error:</p>
  
  <blockquote>
    <p>Application startup exception: System.ArgumentException: The directory name 
        \\TS3410D618\NickFlicks\MoviePosters\ is invalid.</p>
  </blockquote>
  
  <p>This is a valid UNC path and can be reached from everywhere I have tried on my windows 10 machine. As I mentioned everything is on the same machine except for the shared drive. </p>
  
  <p>As a side note I can mount a virtual drive from within IIS sucessfully, so IIS can access the fileshare without any issues.</p>
  
  <p>I'm not sure what I am doing wrong here, any help would be greatly appreciated.</p>