Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
After publishing a new version of a Blazor WebAssembly Hosted app (example: .NET 9.0.3 → 9.0.4), the browser console shows persistent mismatch warnings:
dotnet.runtime.qrl1fuqt3c.js:3 MONO_WASM: The version of dotnet.runtime.js 831d23e56149cd59c40fc00c7feb7c5334bd19c4 is different from the version of dotnet.js 80aa709f5d919c6814726788dc6dabe23e79e672!
dotnet.runtime.qrl1fuqt3c.js:3 MONO_WASM: The version of dotnet.native.js 831d23e56149cd59c40fc00c7feb7c5334bd19c4 is different from the version of dotnet.js 80aa709f5d919c6814726788dc6dabe23e79e672!
Even though the warnings appear, the application continues to function normally.
The root cause seems to be that dotnet.js
is not fingerprinted during publish, so browsers aggressively cache an outdated version across deployments.
This mismatch does not immediately break the app, but could cause issues with larger version upgrades in the future.
Expected Behavior
There should be no version mismatch warnings in the browser console after publishing a new version.
Ideally, dotnet.js
should be fingerprinted (e.g., /dotnet.[hash].js
) during publish, just like dotnet.runtime.js
and dotnet.native.js
are.
This would prevent caching issues and ensure version consistency.
Steps To Reproduce
- Publish a new version of a Blazor WebAssembly Hosted app (e.g., upgrade from .NET 9.0.3 to 9.0.4).
- Visit the site without clearing browser cache.
- Open browser DevTools (F12) and check the console.
- Observe mismatch warnings for dotnet.runtime.js and dotnet.native.js compared to dotnet.js.
Exceptions (if any)
No unhandled exceptions.
Only console warnings are shown.
Application still runs successfully.
.NET Version
9.0.201
Anything else?
Suggestion: Please fingerprint dotnet.js
during publish, similar to other WebAssembly runtime assets.
Alternatively, provide a built-in cache-busting mechanism for critical runtime files at startup.
This would avoid unnecessary confusion for developers and prevent potential app breakage in future upgrades.
Tested on:
- Chrome (latest)
- Edge (latest)
- Deployment server: IIS