I have a web site in ASP.NET Core MVC, and I don't want to put my contents inside another folder. I just want to use the old school of creating this file-system architecture at the root of my project's folder:
Styles
Fonts
Scripts
Images
But I can't make ASP.NET Core MVC serving files from them. For example http://domain.test/styles/default.css
returns 404.
I've tried to add StaticFileOptions
, but I can't get it to work.
Can you help please?
I tried the given solution, that is, to use UseWebRoot("")
with empty string to make it refer to the root of my web project. Yet it still returns 404.
I created a Styles folder inside the \bin\Debug\netcoreapp2.0\
and added a Styles.css there and it served the file.