Uh oh!
There was an error while loading. Please reload this page.
Fix storefront rendering with no CSS/JS (Razor tag helper regression) - #784
Merged
KrzysztofPajak merged 3 commits intoAug 14, 2026
Merged
Conversation
Grand.Plugin.props referenced Grand.Web.Common with ExcludeAssets="all", which also strips compile-time assets. Razor's tag helper discovery for a plugin's Views relies on that compile-time reference, so no plugin (Theme.Modern included) could see host tag helpers (<partial>, <resources>, <vc:*>, etc.) - they were baked into the precompiled view as literal, unprocessed markup. The comment on the line already stated the intent - "referenced for its views and tag helpers, nothing is linked from it" - which is exactly what ExcludeAssets="runtime" does, matching every other reference in this file. Changed all -> runtime. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The 10.0.400 feature-band SDK ships a different Razor compiler build (Microsoft.CodeAnalysis.Razor.Compiler.dll: 10.4.0-preview.26379.115 vs 10.0.301's 10.0.0-preview.26270.133) that fails to wire up tag helpers on Grand.Web's own precompiled views - <partial>, <resources asp-type=...>, <meta-keywords> etc. rendered as literal, unprocessed markup, so the storefront shipped with no CSS/JS at all. Reproduced by building the same source with sdk:10.0.301 (works) vs sdk:10.0.400 (broken), both from mcr.microsoft.com/dotnet/sdk:10.0. Dockerfile now pins the build image to 10.0.301 instead of the floating 10.0 tag. global.json's rollForward was "latestFeature", which is how a local build or CI runner with only the SDK's 400-band installed silently picks up the broken compiler even though the Dockerfile is pinned. Tightened to "latestPatch" against 10.0.301 so every environment building this repo gets the same, verified-working compiler. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The floating 'dotnet-version: 10.0.x' / 'version: 10.0.x' inputs let actions/setup-dotnet and UseDotNet@2 install whatever the newest 10.0 patch is - currently 10.0.400, the feature-band with the broken Razor compiler this PR works around. Tightening global.json's rollForward to latestPatch (previous commit) without fixing this meant CI would install 10.0.400, then dotnet build would refuse to run against it (global.json now demands a 10.0.301.x SDK) - confirmed live on the Azure Pipelines run right after global.json landed: 'dotnet/sdk] ##[error]Error: ... failed with exit code 155' after installing 10.0.400. Pinning every CI SDK install to 10.0.301 keeps it consistent with the Dockerfile and global.json. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #issueNumber
Type: bugfix
Issue
Freshly built/deployed storefront (e.g. via the repo's Dockerfile) rendered with no CSS or JS at all. View-source showed tag helper elements passed through as literal, unprocessed markup instead of being expanded - e.g.
<partial name="Partials/Head"/>,<resources asp-type="HeadLink"/>,<meta-keywords>,<vc:widget .../>all appeared verbatim in the response HTML instead of becoming<link>,<script>,<meta>tags. The admin area was unaffected.Two separate causes, both triggered by the same symptom:
Plugins (Theme.Modern and every other plugin) couldn't see host tag helpers.
Grand.Plugin.propsreferencedGrand.Web.CommonwithExcludeAssets="all", which also excludes compile-time assets - the ones Razor's tag helper discovery needs at plugin-build time. The comment on that line already stated the actual intent ("referenced for its views and tag helpers, nothing is linked from it"), which is whatExcludeAssets="runtime"does (matching every other reference in the file) -allwas the wrong value.A Razor compiler regression between .NET SDK feature bands. Building the exact same source with
mcr.microsoft.com/dotnet/sdk:10.0.301produces a working storefront; building it withmcr.microsoft.com/dotnet/sdk:10.0.400(what the floating10.0tag currently resolves to) reproduces the broken rendering, onGrand.Web's own precompiled views - no plugin orExcludeAssetsinvolved. Confirmed the two SDKs ship genuinely differentMicrosoft.CodeAnalysis.Razor.Compiler.dllbuilds (10.0.0-preview.26270.133vs10.4.0-preview.26379.115, ~109 days of commits apart). Root mechanism inside the compiler not identified; reproduced and pinned as a workaround.Solution
src/Build/Grand.Plugin.props:ExcludeAssets="all"->"runtime"on theGrand.Web.Commonreference.Dockerfile: pin the build image tomcr.microsoft.com/dotnet/sdk:10.0.301instead of the floating10.0tag.global.json:rollForwardtightened fromlatestFeaturetolatestPatchagainst10.0.301, so a local build or CI runner with only a 400-band SDK installed doesn't silently reproduce the same breakage outside Docker.Breaking changes
None. Pinning the SDK is stricter, not looser - anyone building with an SDK older than 10.0.301 already failed under the previous
10.0.100/latestFeatureconfig too.Testing
docker build -t grandnode2:local .App_Data).curl -s http://localhost:8090/ | grep -c 'resources asp-type\|<partial name'-> expect0.curl -s http://localhost:8090/ | grep -oc '<link\b'-> expect several real<link>tags, and confirm/bundles/style.min.css,/bundles/libs.css,/bundles/app.runtime.bundle.jsall return 200.🤖 Generated with Claude Code