Articles → ASP.NET CORE → How ASP.NET Core Serves Static ContentHow ASP.NET Core Serves Static ContentThis article explains how static content is served in ASP.NET Core.Static File Middleware ASP.NET Core provides Static File Middleware to serve static content. To enable it, add the following code to the Configure method in startup.cs.app.UseStaticFiles();What Is The Location Of Static Files? All static files in a web application should be placed in the wwwroot folderExample Consider the following HTML file: -The following output is generated when the HTML file is requested.After commenting out the static file middleware, observe the output.Posted By - Karan Gupta Posted On - Friday, August 23, 2024 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
app.UseStaticFiles();
Query/Feedback