Skip to content

Fix/non asset framework files - #66060

Closed
NetherGranite wants to merge 2 commits into
dotnet:mainfrom
NetherGranite:fix/non-asset-framework-files
Closed

Fix/non asset framework files#66060
NetherGranite wants to merge 2 commits into
dotnet:mainfrom
NetherGranite:fix/non-asset-framework-files

Conversation

@NetherGranite

Copy link
Copy Markdown

This is a draft implementation of #66059.

@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Mar 29, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Mar 29, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Thanks for your PR, @@NetherGranite. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@NetherGranite

Copy link
Copy Markdown
Author

@dotnet-policy-service agree

@javiercn

javiercn commented Jul 24, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution, and for the detailed write-up and history on #66059. We are going to hold off on this one, because the diagnosis it is built on does not match what happens today: blazor.web.js and blazor.server.js are shipped as static web assets, and app.UseStaticFiles() already serves them without MapStaticAssets() (this is what our own server-side Blazor E2E tests exercise, using UseStaticFiles() and MapBlazorHub() with no MapStaticAssets() call). The endpoints removed in #58721 were serving those files from resources embedded in the framework assemblies, which we intentionally stopped doing so the files can be fingerprinted and compressed like any other asset. The failures in #64381 come from the framework JS not being brought into the app as a static web asset in the first place (for example RCL-only hosts, Blazor Hybrid, or library output), so re-adding endpoints that read from the web root would still return 404 in exactly those cases, and would duplicate what UseStaticFiles() already does everywhere else. For hosts that need the framework JS but do not contain a .razor file, the supported way to bring the assets in is the RequiresAspNetWebAssets MSBuild property:

<PropertyGroup>
  <RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>
</PropertyGroup>

Setting that forces the Blazor framework files to be included as static web assets even when the project has no components, after which UseStaticFiles() serves them as usual.

@javiercn javiercn closed this Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants