samedi 11 juin 2016

IIS can't load css and js using OWIN FileServerOptions


I'm using OWIN in a SPA Web Project, my project contains the static files(js and css) inside a folder named public .To make work i'm using UseFileServer method. When i publish in IIS all file references can't be loaded, the iis try to get those files in root path and not inside folder "public".

 app.UseFileServer(new FileServerOptions
        {
            RequestPath = new PathString(string.Empty),
            FileSystem = new PhysicalFileSystem("./public"),
            EnableDirectoryBrowsing = true,
            DirectoryBrowserOptions = { RequestPath = new PathString(string.Empty) },
            StaticFileOptions = { RequestPath = new PathString(string.Empty) }

        });

Files Structure

error image


Aucun commentaire:

Enregistrer un commentaire