You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fingerprinting client-side assets using the old school hosted approach #121993
When running the project from Visual Studio I and viewing the page source in the browser, I can see the import map and the fingerprinted assets:
The documentation says, "In standalone Blazor WebAssembly apps during build/publish, the framework overrides placeholders in index.html with values computed during build to fingerprint static assets for client-side rendering.".
When I publish my application via the Demo.Server project the placeholders are not overridden. The index.html in the published wwwroot still contains the placeholders:
If I publish the Demo.Client project directly the placeholders are overriden.
Is it possible for me to build the Demo.Server but also replace the placeholders in Demo.Client?
changed the title [-]Fingerprinting client-sdie assests using the old school hosted approach[/-][+]Fingerprinting client-side assets using the old school hosted approach[/+]on Nov 26, 2025
I've temporary resolved this issue in super hacky way (don't blame me please).
Place this to Server.csproj
BlazorWebKit - it's my project name, replace it with your own.
<Target Name="PublishBlazorWasmClient" AfterTargets="Publish">
<MSBuild Projects="..\BlazorWebKit.Client\BlazorWebKit.Client.csproj"
Targets="Publish"
Properties="Configuration=$(Configuration);
RuntimeIdentifier=$(RuntimeIdentifier);
_IsPublishing=true;
OverrideHtmlAssetPlaceholders=true;
PublishDir=/tmp/blazor/client"/>
<!-- Clean the server's wwwroot directory before copying new files -->
<RemoveDir Directories="$(PublishDir)wwwroot" ContinueOnError="true" />
<!-- Copy the client's published output (with replaced fingerprints) to server's wwwroot -->
<ItemGroup>
<ClientPublishedFiles Include="/tmp/blazor/client/wwwroot/**/*.*" />
</ItemGroup>
<Copy SourceFiles="@(ClientPublishedFiles)"
DestinationFolder="$(PublishDir)wwwroot\%(RecursiveDir)"
SkipUnchangedFiles="true" />
</Target>
/tmp/blazor/client - cause of linux CI builder. I can't debug the structure of the client published directory on linux and decided to use hardcoded path (docker container with temp published files dies after building).
Thank you for contacting us. I'm looking for the fix.
The underlaying problem is when WebAssembly project is referenced by Server project, MSBuild calls into the referenced project several times. The instance of the project is recreated for each call and so the collection of @(_HtmlStaticWebAssets) is not shared between Build and Publish.
@Vizual-Dev You can workaround the issue for now by opting-out from overriding asset placeholders, by removing <OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders> and updating index.html accordingly
@nahuegallinoti Sorry for late reply. You will loose fingerprint on dotnet.js and blazor.webassembly.js scripts, which is the same situation as we had in .NET 9. Fortunately in hosted scenario, you can control server sent headers for caching
Also just ran into this as we basically did the net 10 upgrade to MapStaticAssets and fingerprinting and got totally blindsided by this. Please add a disclaimer to the documents explaining the migration that states that this is incompatible if serving blazor wasm from an aspnetcore server via project includes. A shame as the fingerprinting would have been nice to have. I hope this gets fixed soon.
Activity
MihuBot commentedon Nov 26, 2025
I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):
[-]Fingerprinting client-sdie assests using the old school hosted approach[/-][+]Fingerprinting client-side assets using the old school hosted approach[/+]aligin commentedon Dec 1, 2025
I've temporary resolved this issue in super hacky way (don't blame me please).
Place this to Server.csproj
BlazorWebKit - it's my project name, replace it with your own.
/tmp/blazor/client- cause of linux CI builder. I can't debug the structure of the client published directory on linux and decided to use hardcoded path (docker container with temp published files dies after building).maraf commentedon Dec 8, 2025
Thank you for contacting us. I'm looking for the fix.
The underlaying problem is when WebAssembly project is referenced by Server project, MSBuild calls into the referenced project several times. The instance of the project is recreated for each call and so the collection of
@(_HtmlStaticWebAssets)is not shared between Build and Publish.Vizual-Dev commentedon Feb 5, 2026
Is there any update on this issue? I am still unable to do a production build.
MarkusRodler commentedon Feb 5, 2026
We've got the same problem -.-
Fix Blazor WASM 404 on static assets when accessed via Tailscale
Fix Blazor WASM 404 on static assets when accessed via Tailscale (#210)
maraf commentedon Feb 10, 2026
@Vizual-Dev You can workaround the issue for now by opting-out from overriding asset placeholders, by removing
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>and updatingindex.htmlaccordinglynahuegallinoti commentedon Feb 11, 2026
@maraf If you remove that attribute, the fingerprint for static files won't work, right? Is there a plan to fix this problem?
Thank you!
maraf commentedon Feb 16, 2026
@nahuegallinoti Sorry for late reply. You will loose fingerprint on
dotnet.jsandblazor.webassembly.jsscripts, which is the same situation as we had in .NET 9. Fortunately in hosted scenario, you can control server sent headers for cachingBlackclaws commentedon Mar 11, 2026
Also just ran into this as we basically did the net 10 upgrade to MapStaticAssets and fingerprinting and got totally blindsided by this. Please add a disclaimer to the documents explaining the migration that states that this is incompatible if serving blazor wasm from an aspnetcore server via project includes. A shame as the fingerprinting would have been nice to have. I hope this gets fixed soon.
nahuegallinoti commentedon May 7, 2026
Is there any update on this issue?
Seth-Harlaar commentedon Jul 22, 2026
Is there any update on this issue?
Fases 2 a 7: temas, catálogos del SAT, empresa, clientes, productos y…
feat(plataforma): temas, catálogos del SAT, empresas, clientes, produ…