From d265a1a81b1f4bcecc71e8a158d4ec8bdcaa63ab Mon Sep 17 00:00:00 2001 From: kawa Date: Tue, 9 Jun 2026 11:35:47 +0200 Subject: [PATCH] Fix 404 on _framework assets in production deploy Blazor framework assets (blazor.web.js) under _framework are served via the static-asset endpoints manifest, not physical wwwroot files. Plain UseStaticFiles only serves physical files, so published deployments returned 404 for blazor.web.js (worked in dev via the dev-time static web assets provider). Switch to MapStaticAssets, which reads the endpoints manifest shipped with publish. Co-Authored-By: Claude Opus 4.8 (1M context) --- Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index be71f2f..9019fb8 100644 --- a/Program.cs +++ b/Program.cs @@ -207,7 +207,7 @@ if (!app.Environment.IsDevelopment()) // Re-execute unmatched (404) requests into the branded not-found page app.UseStatusCodePagesWithReExecute("/not-found"); -app.UseStaticFiles(); +app.MapStaticAssets(); app.UseAuthentication(); app.UseAuthorization(); app.UseAntiforgery();