Overview
Serve static assets by calling UseStaticFiles
in the request processing pipeline.
Static Files in Non-Development Environments
Static assets are only enabled by default in the Development environment. In other environments, call UseStaticWebAssets
on the WebApplicationBuilder
:Program.cs
if (builder.Environment.IsStaging())
{
builder.WebHost.UseStaticWebAssets();
}