Skip to content

Blazor WebAssembly fingerprint not applied in certain publish scenarios #64543

@fredrik-instech

Description

@fredrik-instech

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When running dotnet restore, dotnet build and ``dotnet publish` with certain parameters, the assets fingerprint is not applied to the published index.html file.

Expected Behavior

In the index.html file, the placeholder #[.{fingerprint}] should be replaced with the actual fingerprint.

Steps To Reproduce

Run the following commands:

dotnet new blazorwasm -f net10.0 -n wasm-publish
cd .\wasm-publish\
dotnet restore --verbosity Normal /p:Configuration=Release
dotnet build wasm-publish.sln --configuration Release --no-restore
dotnet publish wasm-publish.csproj --configuration Release --no-build -p:BuildProjectReferences=false

Check the published index.html file: bin\Release\net10.0\publish\wwwroot\index.html

Notice that the blazor.webassembly.js script reference has not been fingerprinted:

<script src="_framework/blazor.webassembly#[.{fingerprint}].js"></script>

This will result in the browser not being able to find the script.

If you run dotnet publish without any arguments, the fingerprint is applied:

dotnet publish wasm-publish.csproj --configuration Release
<script src="_framework/blazor.webassembly.66stpp682q.js"></script>

Exceptions (if any)

No response

.NET Version

10.0.100

Anything else?

I have tried this on Windows 11 and a pipeline agent with Ubuntu 24.04.3.
.NET SDK version 10.0.100
wasm-tools is installed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions