From def8647de1fd581e82ef096a90c9a8fb4f79db48 Mon Sep 17 00:00:00 2001 From: Kawa Date: Thu, 11 Jun 2026 10:51:25 +0200 Subject: [PATCH] Drop --no-restore: it dropped Blazor framework assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause of the production "nothing is interactive" bug. The Dockerfile restored with only the .csproj present (the layer-cache step) and then ran `dotnet publish --no-restore`. That combination silently omits the Blazor framework static assets (wwwroot/_framework/blazor.web.js) from the publish output, so MapStaticAssets 404s the boot script and no interactive circuit starts on any page — buttons, dropdowns (role changes) all dead. Letting publish restore against the full project re-materializes the assets. Reproduced locally and verified the fix. The SDK pin (10.0.203) was a red herring and is left as-is for reproducibility. Co-Authored-By: Claude Opus 4.8 (1M context) --- Dockerfile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 76ba78e..301aa0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,5 @@ # Base images pinned to exact patch for reproducible builds. Floating `:10.0` tags -# drift; a stale/pre-GA SDK base silently drops the Blazor framework static assets -# (blazor.web.js) from the publish manifest → 404 in production. Bump deliberately. -# -# SDK 10.0.300 (feature band 3xx) reintroduced exactly that regression: it published -# an endpoints manifest without blazor.web.js, so MapStaticAssets 404'd the boot -# script and the whole app rendered static (no interactive circuit on any page). -# Feature band 2xx publishes blazor.web.js correctly (verified locally with 10.0.204); -# MCR's newest 2xx image is 10.0.203, used below. Pairs with the 10.0.8 runtime. +# drift between machines; bump deliberately. (SDK 10.0.203 + runtime 10.0.8.) FROM mcr.microsoft.com/dotnet/aspnet:10.0.8 AS base WORKDIR /app EXPOSE 8080 @@ -20,7 +13,13 @@ WORKDIR /src COPY ["SharepointToolbox.Web.csproj", "."] RUN dotnet restore COPY . . -RUN dotnet publish -c Release -o /app/publish --no-restore +# Do NOT add --no-restore here. The restore above runs with only the .csproj present +# (no source, no wwwroot); pairing that cached state with `publish --no-restore` +# silently drops the Blazor framework static assets (wwwroot/_framework/blazor.web.js) +# from the output → the boot script 404s and no interactive circuit starts on any page. +# Letting publish restore against the full project re-materializes them. (Reproduced; +# the early restore above is kept only to cache the NuGet layer.) +RUN dotnet publish -c Release -o /app/publish FROM base AS final WORKDIR /app