Articles → ASP .NET CORE → How Asp.Net Core Serves Static ContentHow Asp.Net Core Serves Static ContentIn this article, we will discuss how asp.net core serves static content.Static File Middleware The asp.net core provides the static file middleware to serve the static content. In the startup.cs file, add the following code in the Configure method to enable static file middleware.app.UseStaticFiles();What Is The Location Of Static Files? All the static files of the web application should be located inside the wwwroot folder.Example Consider the following HTML file: -When you request the HTML file, you will get the following output.Comment the static file middleware code and see 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