From 854f9a81b55445ad1bb9cd8e75d472211e33bb82 Mon Sep 17 00:00:00 2001 From: Atanas Korchev Date: Thu, 12 Mar 2026 14:48:01 +0200 Subject: [PATCH] Pre-generate API reference pages before dotnet publish MSBuild evaluates **/*.razor globs at project evaluation time, before targets run. The GenerateApiPages target creates .razor files too late for them to be compiled on a clean build, resulting in a 13KB DLL with no pages instead of 27MB. Fix by running the generator in a separate step so files exist on disk before publish. --- Dockerfile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 46dd77ab5..72e494805 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,11 +20,16 @@ RUN dotnet restore RadzenBlazorDemos.Host/RadzenBlazorDemos.Host.csproj \ # Copy full source after restore layer COPY . . -# Publish the Blazor host app (API reference pages are generated at build time via MSBuild target) +# Pre-generate API reference pages (must exist on disk before publish evaluates globs) +RUN dotnet build Radzen.Blazor/Radzen.Blazor.csproj -c Release \ + && dotnet run --project Radzen.Blazor.Api.Generator -- \ + Radzen.Blazor/bin/Release/net10.0/Radzen.Blazor.dll \ + Radzen.Blazor/bin/Release/net10.0/Radzen.Blazor.xml \ + Radzen.Blazor.Api/Generated/Pages + +# Publish the Blazor host app (generated pages are now on disk for the SDK to discover) WORKDIR /src/RadzenBlazorDemos.Host -RUN dotnet publish -c Release -o /app/out \ - && test -f /app/out/Radzen.Blazor.Api.dll \ - && echo "API reference assembly found in publish output" +RUN dotnet publish -c Release -o /app/out # =============================