Summary
Aspire.Hosting.Blazor is currently shipped as a stable package at version 13.4.0 alongside an internal preview at 13.5.0-preview.1.26277.21. The 13.4.0 stable build has a packaging layout that breaks the TypeScript polyglot AppHost flow out of the box. We should mark 13.4.0 as unstable / preview to avoid users picking it up assuming it works with the TS AppHost.
Repro (TS polyglot AppHost on Aspire CLI 13.4.0)
- Brownfield TS monorepo with
aspire-apphost/apphost.mts (Aspire 13.4 TS AppHost).
aspire add blazor --version 13.4.0 succeeds and regenerates .aspire/modules/aspire.mts with addBlazorGateway, addBlazorWasmProject, withBlazorClientApp API surface.
- Wire a Blazor WASM client:
const blazorGateway = await builder.addBlazorGateway("blazor-gateway");
const webClient = await builder
.addBlazorWasmProject("web-client", "../clients/web-client/web-client.csproj")
.withReference(api);
await blazorGateway.withBlazorClientApp(webClient, { proxyTelemetry: true });
aspire run fails with:
Capability Error: Could not invoke 'addBlazorGateway': Gateway.cs not found at
'C:\Nuget\aspire.hosting.blazor\13.4.0\lib\net8.0\Scripts\Gateway.cs'.
Ensure the Aspire.Hosting.Blazor package includes the file as content.
Code: INTERNAL_ERROR
Capability: Aspire.Hosting.Blazor/addBlazorGateway
An unexpected error occurred: The TypeScript (Node.js) apphost failed.
Root cause
The package places its gateway scripts under buildTransitive/net8.0/Scripts/:
C:\Nuget\aspire.hosting.blazor\13.4.0\
buildTransitive\net8.0\Scripts\
Gateway.cs <- actual location
PrefixEndpoints.cs
lib\net8.0\
Aspire.Hosting.Blazor.dll
Aspire.Hosting.Blazor.xml <- no Scripts/ folder here
…but the TS polyglot loader for addBlazorGateway resolves Gateway.cs relative to lib/net8.0/Scripts/, so the file is never found. Either the package needs to ship the scripts under lib/net8.0/Scripts/ (or both), or the loader's path resolution needs to look under buildTransitive/net8.0/Scripts/.
Workaround used during validation
New-Item -ItemType Junction `
-Path "C:\Nuget\aspire.hosting.blazor\13.4.0\lib\net8.0\Scripts" `
-Target "C:\Nuget\aspire.hosting.blazor\13.4.0\buildTransitive\net8.0\Scripts"
After the junction, aspire run succeeds, both blazor-gateway and web-client come up Running/Healthy, the WASM HTML loader and /_framework/ assets serve through the gateway, and OTLP traces flow from the gateway into the dashboard.
Asks
- Mark
Aspire.Hosting.Blazor 13.4.0 as unstable / preview in NuGet metadata (or unlist), since the TS AppHost flow is broken without the workaround.
- Fix the packaging layout (or the loader path) in the next 13.4.x patch / next preview so the package works without a junction.
- Add a TS-AppHost end-to-end smoke test for the Blazor integration so this kind of layout drift is caught in CI.
Environment
- OS: Windows 11
- Aspire CLI:
13.4.0+d8c4e9645a029b4fca8ce20eb00def5526806eda
- .NET SDK: 10.0.108
- AppHost: TypeScript (
aspire-apphost/apphost.mts, Node 22.18)
- Package:
Aspire.Hosting.Blazor 13.4.0
Found during Phase 6 of Aspire 13.4 validation.
Summary
Aspire.Hosting.Blazoris currently shipped as a stable package at version 13.4.0 alongside an internal preview at13.5.0-preview.1.26277.21. The 13.4.0 stable build has a packaging layout that breaks the TypeScript polyglot AppHost flow out of the box. We should mark 13.4.0 as unstable / preview to avoid users picking it up assuming it works with the TS AppHost.Repro (TS polyglot AppHost on Aspire CLI 13.4.0)
aspire-apphost/apphost.mts(Aspire 13.4 TS AppHost).aspire add blazor --version 13.4.0succeeds and regenerates.aspire/modules/aspire.mtswithaddBlazorGateway,addBlazorWasmProject,withBlazorClientAppAPI surface.aspire runfails with:Root cause
The package places its gateway scripts under
buildTransitive/net8.0/Scripts/:…but the TS polyglot loader for
addBlazorGatewayresolvesGateway.csrelative tolib/net8.0/Scripts/, so the file is never found. Either the package needs to ship the scripts underlib/net8.0/Scripts/(or both), or the loader's path resolution needs to look underbuildTransitive/net8.0/Scripts/.Workaround used during validation
After the junction,
aspire runsucceeds, bothblazor-gatewayandweb-clientcome up Running/Healthy, the WASM HTML loader and/_framework/assets serve through the gateway, and OTLP traces flow from the gateway into the dashboard.Asks
Aspire.Hosting.Blazor13.4.0 as unstable / preview in NuGet metadata (or unlist), since the TS AppHost flow is broken without the workaround.Environment
13.4.0+d8c4e9645a029b4fca8ce20eb00def5526806edaaspire-apphost/apphost.mts, Node 22.18)Aspire.Hosting.Blazor 13.4.0Found during Phase 6 of Aspire 13.4 validation.