Skip to content

[13.4] Mark Aspire.Hosting.Blazor 13.4.0 as unstable -- Gateway.cs missing from lib/ in TS AppHost flow #17685

@joperezr

Description

@joperezr

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)

  1. Brownfield TS monorepo with aspire-apphost/apphost.mts (Aspire 13.4 TS AppHost).
  2. aspire add blazor --version 13.4.0 succeeds and regenerates .aspire/modules/aspire.mts with addBlazorGateway, addBlazorWasmProject, withBlazorClientApp API surface.
  3. 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 });
  1. 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

  1. 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.
  2. Fix the packaging layout (or the loader path) in the next 13.4.x patch / next preview so the package works without a junction.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-integrationsIssues pertaining to Aspire Integrations packages

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions