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.
Loading...
Related Quiz
- In an ASP.NET Core MVC application for a library, where would the information about available books and their details be stored?
- When creating a custom Tag Helper, which class should it derive from?
- Your team lead mentions the use of a "_Layout.cshtml" file in your ASP.NET Core project. What is the primary role of this file?
- You've heard about two-factor authentication for enhancing security. How can ASP.NET Core Identity help in implementing this feature?
- One of the biggest advantages of ASP.NET Core over traditional ASP.NET is its ability to run on _________.