Skip to content

Conversation

@javiercn
Copy link
Member

@javiercn javiercn commented Sep 21, 2025

[Blazor] Remove unnecessary update to the Blazor webassembly js file

Remove redundant blazor.webassembly.js update that broke publish

Description

Hosted webassembly apps failed to publish due to a bug in how we were trying to update the blazor.webassembly.js asset definition. We realized that we did not have to do so, but that there was a bug precluding us from finding the asset during the publish process.

The fix corrects the identity of the blazor.webassembly.js to account for the fingerprint for the file we introduced in 10.0, which wasn't being taken into account.

Fixes #119886

Customer Impact

Customers with a hosted Blazor WebAssembly + Web API (Server) solution failed to publish. There is no straightforward user workaround short of editing writing a significant amount of MSBuild to work around the issue.

Regression?

  • Yes
  • No

Regressed from .NET 8 (publishing the same project type succeeded in 8.x).

Risk

  • High
  • Medium
  • Low

Justification: The change only removes an unnecessary build step and fixes a case that was exclusively related to Blazor webassembly. It does not alter the contents of the delivered script, pipeline ordering, or introduce new logic— it simply stops creating an anomalous asset entry. Existing publish & static web asset tests still apply. Low surface area and isolated to Blazor WASM publish scenario.

Verification

  • Manual (required)
    • Reproduced failure with unpatched SDK (publish fails).
    • Applied change; publish succeeds
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@javiercn javiercn requested a review from maraf September 21, 2025 10:06
@javiercn javiercn force-pushed the javiercn/fix-blazor-hard-fingerprinting-magic-behavior branch 2 times, most recently from ea052a7 to faec67a Compare September 21, 2025 10:49
@javiercn javiercn marked this pull request as ready for review September 22, 2025 04:46
@javiercn javiercn requested a review from a team as a code owner September 22, 2025 04:46
Copy link
Member

@maraf maraf left a comment

Choose a reason for hiding this comment

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

StaticWebAsset identity for fingerprinted blazor.js is correct

StaticWebAsset identity for fingerprinted blazor.js is correct

@javiercn javiercn force-pushed the javiercn/fix-blazor-hard-fingerprinting-magic-behavior branch from 5146603 to 52ca4a7 Compare September 22, 2025 11:59
@javiercn javiercn force-pushed the javiercn/fix-blazor-hard-fingerprinting-magic-behavior branch 2 times, most recently from 93b1cc7 to 9c74276 Compare September 22, 2025 14:56
@javiercn javiercn force-pushed the javiercn/fix-blazor-hard-fingerprinting-magic-behavior branch from 9c74276 to 0dc4703 Compare September 22, 2025 16:54
@lewing
Copy link
Member

lewing commented Sep 22, 2025

@lewing
Copy link
Member

lewing commented Sep 22, 2025

/backport to release/10.0.1xx-rc2

@github-actions
Copy link
Contributor

Started backporting to release/10.0.1xx-rc2: https://github.com/dotnet/sdk/actions/runs/17931765331

@javiercn javiercn merged commit e6f25ab into release/10.0.1xx Sep 23, 2025
27 checks passed
@javiercn javiercn deleted the javiercn/fix-blazor-hard-fingerprinting-magic-behavior branch September 23, 2025 09:55
@maraf
Copy link
Member

maraf commented Oct 15, 2025

/backport to main

@github-actions
Copy link
Contributor

Started backporting to main: https://github.com/dotnet/sdk/actions/runs/18536167192

lewing added a commit to dotnet/runtime that referenced this pull request Oct 17, 2025
…ng (#120746)

Backport of #120694 to release/10.0

In dotnet/sdk#50949 we changed the identity of
StaticWebAsset to contain fingerprint (dotnet.native.wasm ->
dotnet.native.FP.wasm). This PR accommodates this when checking for
dotnet.native.wasm asset from build.

The SDK change didn't flown to the runtime yet, and so Wasm.Build.Tests
won't test it yet.

Fixes dotnet/aspnetcore#64011

/cc @maraf

## Customer Impact

- [ ] Customer reported
- [x] Found internally

[[Select one or both of the boxes. Describe how this issue impacts
customers, citing the expected and actual behaviors and scope of the
issue. If customer-reported, provide the issue
number.]](dotnet/aspnetcore#64011)

## Regression

- [x] Yes
- [ ] No

Introduced in dotnet/sdk#50949 which added a
fingerprint to the msbuild item identity

## Testing

Manual and automated tests.

## Risk

Low. The change are very scoped to target and items used only by
preloading.

**IMPORTANT**: If this backport is for a servicing release, please
verify that:

- The PR target branch is `release/X.0-staging`, not `release/X.0`.

## Package authoring no longer needed in .NET 9

**IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet
package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older
versions.

---------

Co-authored-by: Marek Fišera <mara@neptuo.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants