-
Notifications
You must be signed in to change notification settings - Fork 503
Fix Test Tool v2 Blazor UI non-interactive on .NET 10 (static assets 404) #2492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
GarrettBeatty
wants to merge
2
commits into
dev
Choose a base branch
from
fix/testtool-net10-static-assets
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+60
−5
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
.autover/changes/156dd8b1-1af2-45fc-b051-b94dc51fc56f.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "Projects": [ | ||
| { | ||
| "Name": "Amazon.Lambda.TestTool", | ||
| "Type": "Patch", | ||
| "ChangelogMessages": [ | ||
| "Fix Blazor web UI being non-interactive on .NET 9+/net10.0. Framework static assets (_framework/blazor.web.js) and the scoped-CSS bundle are now served via MapStaticAssets, the static web assets manifest is composed regardless of hosting environment, and the content root is pinned to the tool's install directory so the assets resolve correctly when running as an installed global tool.", | ||
| "Fix Razor class library content (e.g. the BlazorMonaco code-editor assets under _content/**) returning 404 on .NET 8 when running from a build output (dotnet run), which left the request/response editor uninitialized so selecting an example request could not populate the input. The static web assets manifest is now composed on all target frameworks, and .NET 8 additionally serves static files from the web root file provider so manifest-mapped _content/** assets resolve. Verified across .NET 8/.NET 10, Development/Production, and dotnet-run/installed-tool." | ||
| ] | ||
| } | ||
| ] | ||
| } |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the calls to
UseStaticFilesandMapStaticAssetsdone below is the call still needed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UseStaticWebAssets()— tells the server where the framework/Monaco files actually are (the NuGet cache, via the manifest). Without it the server looks only inwwwroot, doesn't find them, andeverything below has nothing to serve. This is the prerequisite for the other two.
UseStaticFiles(wwwroot)— serves the plain files that do live inwwwroot:app.css, images, favicon. Nothing else serves these, so without it the page loads unstyled.MapStaticAssets()(net9+) — on .NET 9+ the framework files (blazor.web.js) and scoped CSS are served through this newer pipeline, not the classic one. Without it they come back empty,window.Blazornever loads, and the UI is dead. (.NET 8 has noMapStaticAssets, so a secondUseStaticFilesover the manifest-composed provider does the same job.)tried moving some of the code around and updating the comments to be easier to understand. but i tried testing without all of these options and some scenarios did not work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legend for asset kinds:
app.css, images, favicon (physically in wwwroot)_framework/blazor.web.js+ scoped CSS (needed for interactivity)_content/BlazorMonaco/**(needed for the code editor)dotnet runUseStaticFiles(wwwroot)MapStaticAssets()MapStaticAssets()UseStaticWebAssets()— files are in the NuGet cache, not wwwrootUseStaticFiles(wwwroot)MapStaticAssets()MapStaticAssets()ContentRootPathpin — tool launches from an arbitrary cwddotnet runUseStaticFiles(wwwroot)UseStaticFiles(WebRoot)UseStaticWebAssets()— files are in the NuGet cache, not wwwrootUseStaticFiles(wwwroot)UseStaticFiles(wwwroot)ContentRootPathpin — everything's in wwwroot, so the base call covers it