static files in wwwroot is not served in asp.net core mvc 6

cebuhax0r 21 Reputation points
2023-01-21T15:34:41.6233333+00:00

I have files in my wwwroot folder like so

User's image

But still im getting 404 error since the css files are not being served, Even if I try to access it thru localhost:

http://localhost:58233/Content/css-new

The file is still 404 and not found. I already called app.UseStaticFiles(); in Program.cs and I can see

User's image

The files are in the build directory.
This is weird as I assume all files in wwwroot folder should be served to public. What else should I check and what am I doing wrong?
EDIT: I think i know the cause, it does not serve static files without extension, any idea on how to serve files without extension?
EDIT: found the answer, i need to set ServeUnknownFileTypes to true in app.UseStaticFiles()

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
2,605 questions
ASP.NET MVC
ASP.NET MVC
A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
618 questions
{count} votes