Skip to content

Prevent malformed Blazor WebAssembly packages - #69678

Merged
wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:wtgodbe/fix-webassembly-package-validation
Oct 6, 2026
Merged

wtgodbe merged 1 commit into
dotnet:mainfrom
wtgodbe:wtgodbe/fix-webassembly-package-validation

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Prevents concurrent static web asset builds from emitting a Components.WebAssembly package whose manifest references missing JavaScript files. The pack now replaces those final entries deterministically, fails early when assets are unavailable, and verifies both script and source-map package contents. Validated with the focused WebAssemblyPackage_ShipsBlazorWebAssemblyAsFrameworkAsset package-layout test.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 00:09
@wtgodbe
wtgodbe requested a review from a team as a code owner October 6, 2026 00:09
@github-actions github-actions Bot added the area-blazor Includes: Blazor, Razor Components label Oct 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The added test passes without the packaging fix and does not reproduce the reported failure.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Hardens Blazor WebAssembly packaging against missing JavaScript assets and stale package inputs.

Changes:

  • Rebuilds final NuGet asset entries and reports missing files.
  • Checks that the source map ships in the package.
File Description
PackageLayoutTests.cs Adds source-map package assertion.
Microsoft.AspNetCore.Components.WebAssembly.csproj Validates and replaces final package assets.

using var package = PackageArchive.Open(WebAssemblyPackageId);

Assert.True(package.HasEntry("staticwebassets/_framework/blazor.webassembly.js"));
Assert.True(package.HasEntry("staticwebassets/_framework/blazor.webassembly.js.map"));
@wtgodbe
wtgodbe merged commit 16e71d2 into dotnet:main Oct 6, 2026
32 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 7, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants