UNC path is invalid when starting ASP.NET Core Application in IIS

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



UNC path is invalid when starting ASP.NET Core Application in IIS



I have a shared drive on my local network hostnamesharedresource. I have mounted the drive programattically from within the Asp.net core web application in the startup.cs file.


app.UseStaticFiles();

app.UseFileServer(new FileServerOptions
FileProvider = new
PhysicalFileProvider(@"\TS3410D618NickFlicksMovies"),
RequestPath = new PathString("/Movies"),
EnableDirectoryBrowsing = false
);



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:



Application startup exception: System.ArgumentException: The directory name
\TS3410D618NickFlicksMoviePosters is invalid.



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.



As a side note I can mount a virtual drive from within IIS sucessfully, so IIS can access the fileshare without any issues.



I'm not sure what I am doing wrong here, any help would be greatly appreciated.





Learn the differences, and then you should know why blog.lextudio.com/…
– Lex Li
Aug 12 at 23:13









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS