différence between UseFileServer and UseStaticFiles

May 7, 2014 at 11:17 AM

What is the différence between UseFileServer and UseStaticFiles?
Why did you develop both?

May 7, 2014 at 1:03 PM
File Server is composed of several other middlewares, "Static Files" is one of them. So as you can see, Static File middleware is a subset of File Server middleware.

UseStaticFiles is limited in a sense it allows you to only server files from a specific directory under the root of your application. Directory browsing and Default Files features are turned on.

UseFileServer on the other hand is more generic and gives you more options to configure. For instance, you can turn on Directory Browsing, Default Files, and Static Files.

Run this sample code to sense youself the difference: https://aspnet.codeplex.com/SourceControl/latest#Samples/Katana/StaticFilesSample/Startup.cs

Good luck!

Marked as answer by Tratcher on 5/21/2014 at 2:11 PM
May 7, 2014 at 4:22 PM
Marked as answer by Tratcher on 5/21/2014 at 2:11 PM