Skip to content

TypeScript AppHost projects pinned to 13.3.0 crash with TypeLoadException on 13.4 (binary-break from #16677) #16959

Closed

Description

@radical

What users see

Any existing TypeScript AppHost project whose aspire.config.json pins
Aspire.Hosting.JavaScript to 13.3.0 crashes the moment it runs against
a 13.4 CLI:

$ aspire add
...
RPC server exception:
System.TypeLoadException: Could not load type 'Aspire.TypeSystem.AtsJsonCodeWriter'
  from assembly 'Aspire.TypeSystem, Version=42.42.42.42, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
   at Aspire.Hosting.CodeGeneration.TypeScript.AtsTypeScriptCodeGenerator.RenderTypeScriptExportedValue(...)
   at Aspire.Hosting.CodeGeneration.TypeScript.AtsTypeScriptCodeGenerator.WriteTypeScriptExportedValueChildren(...)
   ...
   at Aspire.Hosting.RemoteHost.CodeGeneration.CodeGenerationService.GenerateCode(String language, String assemblyName)

❌ An error occurred while adding the package: Could not load type 'Aspire.TypeSystem.AtsJsonCodeWriter' ...

The failure is in the codegen RPC server, so it's not specific to aspire add —
any operation that triggers TypeScript codegen on a 13.3.0-pinned project hits
the same crash (aspire restore, aspire run, etc.).

Who is affected

Every user who:

  1. Has a TypeScript AppHost project created against 13.3.0 GA, and
  2. Picks up any CLI built off main after 2026-05-05 (when Make AtsJsonCodeWriter a shared internal helper #16677 merged).

That includes the entire 13.4 release once it ships.

Repro

Starting from any TypeScript AppHost project with this aspire.config.json:

{
  "appHost": { "path": "apphost.ts", "language": "typescript/nodejs" },
  "sdk":     { "version": "13.3.0" },
  "packages": { "Aspire.Hosting.JavaScript": "13.3.0" }
}

Install any main-derived 13.4 CLI build and run aspire add (or aspire restore)
in the project.

Confirmed against origin/main @ 124cad0c58 with a locally-built 13.4.0-dev
CLI on a fresh 13.3.0-pinned TypeScript AppHost project.

Cause

#16677 ("Make AtsJsonCodeWriter shared internal helper", merged 892a87558c
on 2026-05-05) removed public class Aspire.TypeSystem.AtsJsonCodeWriter from
Aspire.TypeSystem.dll. The class is now internal in Aspire.Shared.Json,
source-linked per consumer.

The 13.3.0 GA Aspire.Hosting.CodeGeneration.TypeScript.dll was compiled
against the public form and carries a hard TypeRef to
[Aspire.TypeSystem v13.3.0.0] Aspire.TypeSystem.AtsJsonCodeWriter. The 13.4
Aspire.TypeSystem.dll no longer defines that type and there is no
[TypeForwardedTo] shim, so the runtime throws TypeLoadException as soon as
any codegen path touches it.

The 13.4 CLI does not detect or shield users from this — it restores the
13.3.0 codegen DLL the project pins, then loads it against its own bundled
13.4 Aspire.TypeSystem.dll.

Related

cc Sébastien Ros (@sebastienros)

Activity

  1. sebastienros commented on May 11, 2026

    @sebastienros
    Contributor

    I am surprised this was not part of 13.3 build already
    cc Eric Erhardt (@eerhardt)

  2. sebastienros commented on May 11, 2026

    @sebastienros
    Contributor

    To me it looks like it was merged in 13.3, here is the tag's commits: https://github.com/microsoft/aspire/commits/v13.3.0

  3. joperezr commented on May 11, 2026

    @joperezr
    Member
    🤖 Aspire triage pass — 2026-05-11 23:00 UTC

    Area: area-cli, area-polyglot
    Kind: regression
    Repro: yes-minimal — pinned aspire.config.json shown verbatim; reproduced against origin/main @ 124cad0c58 with a locally-built 13.4.0-dev CLI on a fresh 13.3.0-pinned TypeScript AppHost project
    Affected version(s): any main-derived 13.4 CLI build (after #16677 merged on 2026-05-05) running against a TypeScript AppHost pinned to Aspire.Hosting.JavaScript 13.3.0
    Severity: S1 — fleet-wide outage scenario: every TypeScript AppHost pinned to 13.3.0 GA crashes the moment it picks up 13.4 (including the entire 13.4 release once it ships), no in-product workaround

    Urgency: 🔴 servicing — recommend milestone 13.4 (ship-blocker for 13.4)
    Reason: hard binary break introduced in main by #16677 (Aspire.TypeSystem.AtsJsonCodeWriter removed without [TypeForwardedTo] shim). 13.3.0 codegen DLLs carry a TypeRef to the removed type, throw TypeLoadException on first codegen call. Also threatens release/13.3 if backport #16752 ships without a compat shim — flag for servicing review too.

    Suggested owner(s): Sébastien Ros (@sebastienros) (already cc'd; owns Aspire.Hosting.RemoteHost, /src/Aspire.Hosting/Ats, polyglot per CODEOWNERS), backup James Newton-King (@JamesNK)
    Evidence:

    Confidence: high
    Needs human?: no — but please double-check the 13.4 vs 13.3-servicing call: the fix probably ships in 13.4 (add a [TypeForwardedTo] shim or revert the public-API removal), and any release/13.3 servicing build picking up #16752 needs the same shim

    Dry-run mode — no labels or milestone applied. Reply /triage apply to promote, or edit and reapply.

  4. eerhardt commented on May 12, 2026

    @eerhardt
    Member

    I believe you have a corrupt nuget cache (since we had multilpe builds with 13.3.0).

    Try clearing your nuget cache and try again. dotnet nuget locals all -c

    The reason I think this is:

    System.TypeLoadException: Could not load type 'Aspire.TypeSystem.AtsJsonCodeWriter'
      from assembly 'Aspire.TypeSystem, Version=42.42.42.42, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
    

    42.42.42.42 is a locally built version or a PR built version.

  5. added this to the 13.4 milestone on May 13, 2026
  6. locked and limited conversation to collaborators on Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions