Which method is commonly used in the Startup.cs file to enable the serving of static files in an ASP.NET Core application?

  • app.UseStaticFiles()
  • app.EnableStaticFiles()
  • app.ServeStaticFiles()
  • app.StaticFiles()
The app.UseStaticFiles() method is commonly used in the Startup.cs file to enable the serving of static files in an ASP.NET Core application. This middleware allows you to serve files such as HTML, CSS, JavaScript, and images directly from your web application. It's a crucial step for rendering client-side resources.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *