Skip to content

Enrich AppHost codegen TypeLoadException diagnostics#17262

Merged
IEvangelist merged 4 commits into
mainfrom
dapine/fix-typeload-exception-16709
May 27, 2026
Merged

Enrich AppHost codegen TypeLoadException diagnostics#17262
IEvangelist merged 4 commits into
mainfrom
dapine/fix-typeload-exception-16709

Conversation

@IEvangelist
Copy link
Copy Markdown
Member

@IEvangelist IEvangelist commented May 19, 2026

TypeScript AppHost code generation can fail with empty TypeLoadException

Fix #16709, closes #16959

Description

When the installed Aspire CLI ships an aspire-managed server whose bundled Aspire.Hosting.dll is on a different build than the user-restored Aspire.Hosting.CodeGeneration.TypeScript / Aspire.Hosting.JavaScript / Aspire.TypeSystem DLLs (case reported in #16709 was CLI 26218 + SDK 26227), reflection-based code generation can throw a JIT-emitted TypeLoadException with no message. That exception travels back to the CLI over JSON-RPC with no message, no type name, and no assembly identity, producing:

❌ Failed to run TypeScript (Node.js) AppHost:
System.TypeLoadException:
   at Aspire.Hosting.CodeGeneration.TypeScript.AtsTypeScriptCodeGenerator.GenerateAspireSdk(...)

…followed by a 60-second backchannel timeout.

Changes

Three coordinated improvements:

  1. Server-side: enrich reflection-load exceptions before they cross the JSON-RPC boundary.

    • New CodeGenerationDiagnosticBuilder in Aspire.Hosting.RemoteHost.CodeGeneration wraps TypeLoadException, MissingMethodException, MissingFieldException, BadImageFormatException, FileLoadException, and ReflectionTypeLoadException (including walking LoaderExceptions) into a LocalRpcException with two parts:
      • Message — short, safe, language-agnostic: "… SDK code generation failed because the installed Aspire CLI appears to be incompatible with the configured Aspire SDK. Run 'aspire update' to align the CLI and SDK and try again." No .NET type names, no assembly identities.
      • ErrorData (structured CodeGenerationDiagnostic) — TypeName, MemberName, loaded ATS assemblies + informational versions, runtime Aspire.Hosting version, original exception type, remediation hint.
    • JSON-RPC error code -32050 (reserved server-error range) used as the contract between server and CLI.
    • AssemblyLoader.GetLoadedAssemblyDiagnostics() exposes a snapshot of loaded ATS assemblies for the diagnostic payload.
  2. CLI-side: tiered output + actionable post-failure diagnostic.

    • Pre-flight (always shown): when VersionHelper.GetDefaultTemplateVersion() and aspire.config.json SDK version differ on major/minor/patch (modulo build suffix), emit a yellow warning naming both versions and pointing at aspire update.
    • Default failure rendering (non-debug): show the safe summary + remediation hint + closing line "Run with --debug for full diagnostic details." Full structured payload is logged via LogDebug regardless.
    • --debug failure rendering: also display OriginalExceptionType, TypeName, MemberName, runtime Aspire.Hosting version, and loaded assemblies so a maintainer can diagnose the underlying CLR problem.
    • Fault BackchannelCompletionSource immediately on codegen failure so users no longer wait through the 60-second timeout.
    • New AppHostCodeGenerationDiagnostic (CLI mirror DTO) + AppHostCodeGenerationException typed exception. The diagnostic DTO is registered in BackchannelJsonSerializerContext for AOT-safe deserialization of RemoteInvocationException.DeserializedErrorData / ErrorData JsonElement.
  3. CLI-side: prune stale backchannel sockets at startup.

    • CliPathHelper.CleanupStaleCliSockets(directory, maxAge, timeProvider?) deletes cli.sock.* files in ~/.aspire/cli/runtime/sockets/ older than 24 hours (mtime-based, since the filename encodes only a random GUID — no PID). Runs lazily once per process via Interlocked.CompareExchange. Pure housekeeping — no user-visible output, exceptions on individual files are swallowed.

Tests

  • tests/Aspire.Hosting.RemoteHost.Tests/CodeGenerationDiagnosticBuilderTests.cs (new, 7 tests) — non-reflection exception returns null; TypeLoadException (with/without message) wraps to LocalRpcException + structured ErrorData; default Message doesn't leak the .NET type name; MissingMethodException populates MemberName; wrapped/inner-exception walking; ReflectionTypeLoadException.LoaderExceptions walking; runtime Aspire.Hosting version capture.
  • tests/Aspire.Cli.Tests/Projects/GuestAppHostProjectSkewTests.cs (new, 10 tests)IsKnownIncompatibleSkew correctly flags major/minor/patch differences while ignoring build suffix; NormalizeVersion strips +build metadata; falls back to string comparison for unparseable versions.
  • tests/Aspire.Cli.Tests/Utils/CliPathHelperTests.cs — extended with 4 janitor tests: stale files deleted, newer files kept, only cli.sock.* prefix matched, missing directory and empty directory are no-ops. Uses Microsoft.Extensions.Time.Testing.FakeTimeProvider for deterministic time.

User-visible behavior change

Before (issue #16709):

❌ Failed to run TypeScript (Node.js) AppHost:
System.TypeLoadException:
   at Aspire.Hosting.CodeGeneration.TypeScript.AtsTypeScriptCodeGenerator.GenerateAspireSdk(...)
[60 second wait]

After (default):

⚠  The installed Aspire CLI version (13.4.0-preview.1.26218.1) differs from the configured
   Aspire SDK version (13.4.0-preview.1.26227.1). If you run into errors, run 'aspire update'
   to align them.
❌ TypeScript (Node.js) SDK code generation failed because the installed Aspire CLI appears
   to be incompatible with the configured Aspire SDK. Run 'aspire update' to align the CLI
   and SDK and try again.
ℹ  Run with '--debug' for full diagnostic details.
[exits immediately]

After (--debug):
…same as above, plus:

🔬 Diagnostic details:
🔬   Exception: System.TypeLoadException
🔬   Type: Aspire.Hosting.SomeType
🔬   Runtime Aspire.Hosting: 13.4.0-preview.1.26218.1+abc123
🔬   • Aspire.Hosting.CodeGeneration.TypeScript 13.4.0-preview.1.26227.1+def456
🔬   • Aspire.TypeSystem 13.4.0-preview.1.26227.1+def456

Build / test verification

  • ./build.cmd /p:SkipNativeBuild=true → clean.
  • 11 new tests pass locally. The 3 pre-existing failures I saw (AssemblyLoaderTests.GetAssemblies_AddsAssemblyNamesToProfilingSpan, RemoteHostProfilingTelemetryTests.AssemblyLoad_AddsAssemblyNames, ListConsoleLogsToolTests.ListConsoleLogsTool_ReturnsLogs_ForSpecificResource) reproduce on a clean upstream/main checkout without my changes and are unrelated (parallel-listener race on a shared static ActivitySource, and a Windows CRLF/LF expectation, respectively).
  • XLF files auto-regenerated by the build for the 4 new ErrorStrings entries; they'll be retranslated by the loc workflow.

Out of scope / notes

  • No retry on TypeLoadException — we surface a clear diagnostic and exit, matching the issue's Expected behavior.
  • No automatic mutation of aspire.config.json to pin a matching SDK version; we suggest aspire update in the message.
  • Stale socket sweep deletes by mtime only because cli.sock.<guid> files don't encode a PID. The 24h threshold is comfortably longer than any legitimate Aspire CLI run.
  • Privacy/UX: by default, no .NET type names, no Aspire.Hosting* assembly identities, no CLR stack traces are shown to the user. Those details are only revealed with --debug (and are always written to the existing debug log file at ~/.aspire/logs/cli_*.log).

Closes #16709.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Copilot AI review requested due to automatic review settings May 19, 2026 16:33
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17262

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17262"

@IEvangelist IEvangelist marked this pull request as draft May 19, 2026 16:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves Aspire guest AppHost (TypeScript/JavaScript) codegen failure diagnostics when the installed CLI’s bundled server assemblies are incompatible with user-restored SDK/codegen assemblies, avoiding empty TypeLoadException output and long backchannel timeouts.

Changes:

  • RemoteHost: Wrap reflection/load failures into a LocalRpcException with a safe message + structured CodeGenerationDiagnostic (-32050).
  • CLI: Detect CLI/SDK version skew, render tiered diagnostics (default vs --debug), and fail fast on codegen errors; add stale cli.sock.* cleanup.
  • Add unit tests and localizable error strings.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/Aspire.Hosting.RemoteHost.Tests/CodeGenerationDiagnosticBuilderTests.cs Adds tests for server-side diagnostic wrapping and payload contents.
tests/Aspire.Cli.Tests/Utils/CliPathHelperTests.cs Adds tests for stale socket cleanup behavior.
tests/Aspire.Cli.Tests/Projects/GuestAppHostProjectSkewTests.cs Adds tests for CLI/SDK skew detection and version normalization.
src/Aspire.Hosting.RemoteHost/CodeGeneration/CodeGenerationService.cs Wraps codegen RPC failures with enriched diagnostics before crossing JSON-RPC.
src/Aspire.Hosting.RemoteHost/CodeGeneration/CodeGenerationDiagnostic.cs Introduces diagnostic DTOs, error codes, and builder for wrapping load/reflection exceptions.
src/Aspire.Hosting.RemoteHost/AssemblyLoader.cs Exposes loaded-assembly diagnostics for inclusion in codegen failure payloads.
src/Aspire.Cli/Utils/CliPathHelper.cs Adds stale cli.sock.* pruning and runs it once per process.
src/Aspire.Cli/Resources/xlf/ErrorStrings.zh-Hant.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.zh-Hans.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.tr.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.ru.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.pt-BR.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.pl.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.ko.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.ja.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.it.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.fr.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.es.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.de.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/xlf/ErrorStrings.cs.xlf Adds new localization entries for codegen diagnostics output.
src/Aspire.Cli/Resources/ErrorStrings.resx Adds new localized resource strings for codegen diagnostics.
src/Aspire.Cli/Resources/ErrorStrings.Designer.cs Regenerates designer for new resource keys.
src/Aspire.Cli/Projects/GuestAppHostProject.cs Adds skew warning + tiered codegen error rendering; faults backchannel promptly on codegen failure.
src/Aspire.Cli/Projects/AppHostRpcClient.cs Converts RPC error -32050 into a typed exception with deserialized diagnostic payload.
src/Aspire.Cli/Projects/AppHostCodeGenerationException.cs New typed exception carrying structured diagnostic data.
src/Aspire.Cli/Projects/AppHostCodeGenerationDiagnostic.cs New CLI-side diagnostic DTO + mirrored error code constant.
src/Aspire.Cli/Backchannel/BackchannelJsonSerializerContext.cs Registers new diagnostic DTO types for AOT-safe deserialization.
Files not reviewed (1)
  • src/Aspire.Cli/Resources/ErrorStrings.Designer.cs: Language not supported

Comment thread src/Aspire.Cli/Utils/CliPathHelper.cs
Comment thread tests/Aspire.Cli.Tests/Utils/CliPathHelperTests.cs Outdated
Comment thread tests/Aspire.Cli.Tests/Utils/CliPathHelperTests.cs Outdated
Comment thread tests/Aspire.Cli.Tests/Utils/CliPathHelperTests.cs Outdated
Comment thread tests/Aspire.Cli.Tests/Utils/CliPathHelperTests.cs Outdated
@IEvangelist
Copy link
Copy Markdown
Member Author

PR Testing Report

Tested the dogfood build of this PR on Windows (local mode).

CLI Version Verification

  • Expected head commit: 0f1e48c
  • Installed CLI reported: 13.4.0-pr.17262.g0f1e48c3
  • Status: ✅ Verified

Test Scenarios Executed

# Scenario Status Evidence
1 CLI install + version match ✅ Pass aspire --version13.4.0-pr.17262.g0f1e48c3
2 TypeScript AppHost happy path (no skew) ✅ Pass aspire start → AppHost started, dashboard reachable → aspire stop clean
3 SDK/CLI skew warning (key behavior) ✅ Pass See below
4 C# AppHost happy path (socket janitor non-regression) ✅ Pass aspire start → AppHost started → aspire stop clean
5 Stale socket janitor ✅ Pass Stale cli.sock.<guid> (36 h) deleted; fresh cli.sock.<guid> kept; other.sock.<guid> (36 h, wrong prefix) kept

Scenario 3 details

Modified aspire.config.json sdk.version to 12.0.0-preview.1.99999.1 (different major than CLI 13.4.0). The warning fired exactly as documented in the PR description (captured from the child detach log):

⚠️ The installed Aspire CLI version (13.4.0-pr.17262.g0f1e48c3)
   differs from the configured Aspire SDK version (12.0.0-preview.1.99999.1).
   If you run into errors, run 'aspire update' to align them.

Companion LogDebug line also fired:

[DBUG] [GuestAppHostProject] Aspire CLI/SDK version skew detected
       (CLI=13.4.0-pr.17262.g0f1e48c3, SDK=12.0.0-preview.1.99999.1)

Notes for follow-up

  1. Skew warning visibility in aspire start detach mode. The warning fires from GenerateCodeViaRpcAsync in the detached AppHost child process, not the parent CLI. In aspire start (detach), only the trailing lines of child stdout get relayed back. If the AppHost then fails fast (in my synthetic skew test, the wrong-version SDK produced a broken .modules/aspire.ts and the TypeScript compile failed), the warning gets pushed out of the relayed tail and users see only the downstream ❌ AppHost process exited with code 2. The warning is clearly present in:

    • cli_*_detach-child_*.log
    • aspire run (non-detach) terminal output
    • any flow where the AppHost reaches a steady state after codegen

    Worth considering hoisting the skew check into the parent CLI as well (reading aspire.config.json directly there) so users in detach mode see it even when the child fails before the relay catches up. Not blocking — just a UX polish for the specific case the PR targets.

  2. Janitor scope. CleanupStaleCliSockets runs inside CreateSocketPath, so it only triggers on commands that create a CLI socket (start, run, etc.) — not on aspire --version / --help. That's fine functionally (sockets only accrue on real commands anyway), but the PR description's "Runs lazily once per process" phrasing could be sharpened to "Runs lazily once per process, on the first socket creation" in a doc comment.

Verified happy-path non-regressions

  • Both C# (aspire-empty / apphost.cs file-based) and TypeScript (aspire-ts-empty) AppHosts start, expose a dashboard, and stop cleanly with the PR build.
  • No TypeLoadException or other reflection-load failures observed in the happy path; the new diagnostic wrapping doesn't change anything when codegen succeeds.

🤖 Generated by a Copilot CLI PR-testing session.

@IEvangelist IEvangelist marked this pull request as ready for review May 19, 2026 21:04
@sebastienros
Copy link
Copy Markdown
Contributor

Is it also fixing #16959 ? Dupe?

@IEvangelist
Copy link
Copy Markdown
Member Author

Is it also fixing #16959 ? Dupe?

Probably, looks similar.

Comment thread src/Aspire.Cli/Projects/GuestAppHostProject.cs Outdated
@IEvangelist IEvangelist force-pushed the dapine/fix-typeload-exception-16709 branch 3 times, most recently from 6140e09 to 17d2629 Compare May 26, 2026 18:16
Comment thread src/Aspire.Cli/Utils/CliPathHelper.cs Outdated
IEvangelist and others added 3 commits May 26, 2026 16:07
When the installed Aspire CLI ships an �spire-managed server whose bundled Aspire.Hosting.dll is on a different build than the user-restored Aspire.Hosting.CodeGeneration.TypeScript / Aspire.TypeSystem DLLs, reflection-based codegen can throw an empty TypeLoadException that travels back to the CLI with no message and triggers a 60-second backchannel timeout.

This change adds three coordinated improvements:

1. Server-side: wrap reflection-load exceptions (TypeLoadException, MissingMethodException, MissingFieldException, BadImageFormatException, FileLoadException, ReflectionTypeLoadException) in a LocalRpcException with a safe, language-agnostic Message and a structured ErrorData payload (TypeName, MemberName, loaded ATS assemblies + informational versions, runtime Aspire.Hosting version, original exception type) carried via JSON-RPC error code -32050.

2. CLI-side: tiered output — emit a yellow pre-flight warning on detected CLI/SDK skew; render only the safe summary + remediation hint by default; reveal the full .NET diagnostic payload under --debug; always log the full payload via LogDebug. Also fault the BackchannelCompletionSource immediately on codegen failure so users no longer wait through the 60s timeout.

3. CLI-side: prune leftover cli.sock.* files older than 24 hours from ~/.aspire/cli/runtime/sockets/ on startup so stale entries don't accumulate from previous crashed runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Drop [JsonPropertyName(camelCase)] from CLI diagnostic DTO so the
  source-generated context deserializes the server's default PascalCase
  payload. Add a wire-contract test that round-trips the on-the-wire
  shape and the BackchannelJsonSerializerContext options.
- Use SemVersion.ComparePrecedence in IsKnownIncompatibleSkew so SemVer
  prerelease identifiers are compared (the #16709 case:
  13.4.0-preview.1.26218.1 vs 13.4.0-preview.1.26227.1). Update skew
  tests to cover prerelease and build-metadata cases.
- Resolve the runtime Aspire.Hosting version by walking
  AppDomain.CurrentDomain.GetAssemblies(); never fall back to
  Aspire.Hosting.RemoteHost (which is what typeof(AssemblyLoader)
  returned). Add a regression test.
- Only the diagnostic-section header keeps the microscope emoji; the
  continuation lines (Exception, Type, Member, runtime version, loaded
  assemblies) render as plain text indented under the header.
- Tests: use Directory.CreateTempSubdirectory() instead of manually
  combining Path.GetTempPath() + Guid for CliPathHelper janitor tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebastienros sebastienros force-pushed the dapine/fix-typeload-exception-16709 branch from 6b31a1d to b1e3bac Compare May 26, 2026 23:08
Comment thread src/Aspire.Cli/Projects/AppHostRpcClient.cs
Comment thread src/Aspire.Cli/Projects/GuestAppHostProject.cs
@github-actions
Copy link
Copy Markdown
Contributor

Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@sebastienros
Copy link
Copy Markdown
Contributor

Do we expect this will help with more failing scenarios than the one expose in the original issues? (version mismatch -> TypeLoadExpresion)? If not this is a lot of work for this case, and maybe we should give it more testing time than merge it now.

We could even revert the interning of the type that is causing the mismatch.

@IEvangelist
Copy link
Copy Markdown
Member Author

Do we expect this will help with more failing scenarios than the one expose in the original issues? (version mismatch -> TypeLoadExpresion)? If not this is a lot of work for this case, and maybe we should give it more testing time than merge it now.

We could even revert the interning of the type that is causing the mismatch.

Yes — this helps beyond the specific TypeLoadException in #16709.
It covers the broader reflection-load ABI mismatch class (TypeLoad/MissingMethod/MissingField/ReflectionTypeLoad/BadImageFormat/FileLoad), and fails fast instead of ending in the 60s timeout.
Reverting one interned type would only patch this instance; the next skew would still fail opaquely. This PR keeps the success path unchanged and improves failure diagnostics.

- Catch AppHostCodeGenerationException in sdk dump per-integration path so one failing integration does not abort the full Task.WhenAll batch.
- Log the full serialized AppHostCodeGenerationDiagnostic payload in RenderCodeGenerationFailure so debug logs match the XML doc contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@IEvangelist IEvangelist enabled auto-merge (squash) May 27, 2026 18:30
@IEvangelist IEvangelist merged commit 823ddf6 into main May 27, 2026
616 of 619 checks passed
@IEvangelist IEvangelist deleted the dapine/fix-typeload-exception-16709 branch May 27, 2026 18:57
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.5 milestone May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

CLI E2E Tests failed — 106 passed, 1 failed, 2 unknown (commit 0ee9003)

Failed Tests

View all recordings
Status Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View recording
AddPackageWhileAppHostRunningDetached ▶️ View recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View recording
AgentInitCommand_DefaultSelection_InstallsDefaultSkills ▶️ View recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View recording
AgentMcpListStructuredLogsReturnsLogsFromStarterApp ▶️ View recording
AgentMcpListStructuredLogsReturnsLogsFromStarterApp_DevLocalhost ▶️ View recording
AgentMcpListStructuredLogsReturnsLogsFromStarterApp_Isolated ▶️ View recording
AllPublishMethodsBuildDockerImages ▶️ View recording
AspireAddAndStartWorkAgainstLegacyAppHostTs ▶️ View recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View recording
AspireInitSingleFileAppHostRunsViaDotnetRunAppHost ▶️ View recording
AspireInitWithExistingAppHostDirRecreatesMissingNuGetConfigAndPreservesFiles ▶️ View recording
AspireInitWithSolutionFileGeneratesAppHostThatBuildsAgainstChannelHive ▶️ View recording
AspireStartUpdatesStaleTypeScriptAppHostPath ▶️ View recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View recording
AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent ▶️ View recording
Banner_DisplayedOnFirstRun ▶️ View recording
Banner_DisplayedWithExplicitFlag ▶️ View recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View recording
CertificatesClean_RemovesCertificates ▶️ View recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View recording
CreateAndRunAspireStarterProject ▶️ View recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View recording
CreateAndRunEmptyAppHostProject ▶️ View failure recording
CreateAndRunJavaEmptyAppHostProject ▶️ View recording
CreateAndRunJsReactProject ▶️ View recording
CreateAndRunPythonReactProject ▶️ View recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View recording
CreateAndRunTypeScriptStarterProject ▶️ View recording
CreateJavaAppHostWithViteApp ▶️ View recording
CreateTypeScriptAppHostWithViteApp_AllowsGuestAppPackageManagerToDiffer ▶️ View recording
CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain ▶️ View recording
DashboardRunWithAgentMcpListTracesReturnsNoTraces ▶️ View recording
DashboardRunWithAgentMcpListTracesReturnsNoTraces_DevLocalhost ▶️ View recording
DashboardRunWithOtelTracesReturnsNoTraces ▶️ View recording
DashboardRunWithOtelTracesReturnsNoTraces_DevLocalhost ▶️ View recording
DeployK8sBasicApiService ▶️ View recording
DeployK8sWithExternalHelmChart ▶️ View recording
DeployK8sWithGarnet ▶️ View recording
DeployK8sWithMongoDB ▶️ View recording
DeployK8sWithMySql ▶️ View recording
DeployK8sWithPostgres ▶️ View recording
DeployK8sWithRabbitMQ ▶️ View recording
DeployK8sWithRedis ▶️ View recording
DeployK8sWithSqlServer ▶️ View recording
DeployK8sWithValkey ▶️ View recording
DeployTypeScriptAppToKubernetes ▶️ View recording
DescribeCommandResolvesReplicaNames ▶️ View recording
DescribeCommandShowsRunningResources ▶️ View recording
DetachFormatJsonProducesValidJson ▶️ View recording
DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance ▶️ View recording
DoPublishAndDeployListStepsWork ▶️ View recording
DocsCommand_RendersInteractiveMarkdownFromLocalSource ▶️ View recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View recording
DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain ▶️ View recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View recording
GatewayWithoutExternalEndpoint_FailsPublishWithGuidance ▶️ View recording
GeneratedAspireDevScript_StartsWatchMode_WithConfiguredToolchain ▶️ View recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View recording
GlobalMigration_PreservesAllValueTypes ▶️ View recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View recording
IngressWithoutExternalEndpoint_FailsPublishWithGuidance ▶️ View recording
InitTypeScriptAppHost_AugmentsExistingViteRepoInWorkspaceSubdirectory ▶️ View recording
InteractiveCSharpInitCreatesExpectedFiles ▶️ View recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View recording
JavaScriptHostingApisRunFromTypeScriptAppHost ▶️ View recording
LatestCliCanStartStableChannelAppHost ▶️ View recording
LatestCliCanStartStableChannelTypeScriptAppHost ▶️ View recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View recording
LogsCommandShowsResourceLogs ▶️ View recording
OtelLogsReturnsStructuredLogsFromStarterApp ▶️ View recording
OtelLogsReturnsStructuredLogsFromStarterAppIsolated ▶️ View recording
PsCommandListsRunningAppHost ▶️ View recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View recording
PublishJavaScriptPatternsGeneratesExpectedDockerComposeArtifacts ▶️ View recording
PublishWithConfigureEnvFileUpdatesEnvOutput ▶️ View recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View recording
PublishWithoutOutputPathUsesAppHostDirectoryDefault ▶️ View recording
ResourceCommand_FailedExecution_DisplaysAppHostLogPathAndLogContainsEntries ▶️ View recording
ResourceCommand_SetAndDeleteParameterUpdatesDescribeOutput ▶️ View recording
RestoreGeneratesSdkFiles ▶️ View recording
RestoreGeneratesSdkFiles_WithConfiguredToolchain ▶️ View recording
RestoreRefreshesGeneratedSdkAfterAddingIntegration ▶️ View recording
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View recording
RunReportsSyntaxErrorsForDotNetAppHost ▶️ View recording
RunReportsSyntaxErrorsForTypeScriptAppHost ▶️ View recording
SecretCrudOnDotNetAppHost ▶️ View recording
SecretCrudOnTypeScriptAppHost ▶️ View recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View recording
StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets ▶️ View recording
StartReportsSyntaxErrorsForDotNetAppHost ▶️ View recording
StartReportsSyntaxErrorsForTypeScriptAppHost ▶️ View recording
StopAllAppHostsFromAppHostDirectory ▶️ View recording
StopJavaPolyglotAppHostUsingApphostDirectory ▶️ View recording
StopNonInteractiveSingleAppHost ▶️ View recording
StopTypeScriptPolyglotAppHostUsingApphostDirectory ▶️ View recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View recording
UnAwaitedChainsCompileWithAutoResolvePromises ▶️ View recording
UpdateProjectChannelToStable_CSharpEmptyAppHost_PreservesAspireConfigChannel ▶️ View recording
UpdateProjectChannelToStable_CSharpSingleFileInit_PreservesAspireConfigChannel ▶️ View recording
UpdateProjectChannelToStable_TypeScriptSingleFileInit_PreservesAspireConfigChannel ▶️ View recording
UpdateProjectChannelToStable_TypeScript_PreviewsStablePackagesAndPreservesChannel ▶️ View recording

📹 Recordings uploaded automatically from CI run #26530042485

aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request May 27, 2026
…sion mismatch

Documents the improved codegen failure output introduced in microsoft/aspire#17262:
- CLI/SDK version skew warning before AppHost startup
- Actionable error message on codegen failure (replaces bare TypeLoadException)
- --debug flag for full diagnostic details
- aspire update as the recommended fix

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@aspire-repo-bot
Copy link
Copy Markdown
Contributor

Pull request created: #1101

Generated by PR Documentation Check

@aspire-repo-bot
Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1101 targeting release/13.4.

Added a Troubleshooting codegen failures section to src/frontend/src/content/docs/app-host/typescript-apphost.mdx documenting the improved TypeScript AppHost codegen diagnostics:

  • CLI/SDK version mismatch pre-flight warning (yellow, names both versions, suggests aspire update)
  • New actionable error message on codegen failure replacing the bare TypeLoadException
  • --debug flag usage for detailed diagnostic output
  • aspire update as the fix; also added to the See also list

Note

This draft PR needs human review before merging.

@IEvangelist
Copy link
Copy Markdown
Member Author

/backport to release/13.4

@github-actions
Copy link
Copy Markdown
Contributor

Started backporting to release/13.4 (link to workflow run)

IEvangelist added a commit to microsoft/aspire.dev that referenced this pull request Jun 1, 2026
…match (#1101)

* docs: document TypeScript AppHost codegen diagnostics and CLI/SDK version mismatch

Documents the improved codegen failure output introduced in microsoft/aspire#17262:
- CLI/SDK version skew warning before AppHost startup
- Actionable error message on codegen failure (replaces bare TypeLoadException)
- --debug flag for full diagnostic details
- aspire update as the recommended fix

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review feedback (4 threads)

- Use placeholder versions and align diagnostic output (PRRT_kwDOQK_VN86FNwD2)

- Remove color-specific warning wording (PRRT_kwDOQK_VN86FNwck)

- Point version-skew checks at sdk.version (PRRT_kwDOQK_VN86Ftvl9)

- Include prerelease identifiers in mismatch criteria (PRRT_kwDOQK_VN86FtvmJ)

Verified against microsoft/aspire@565af53 on branch release/13.4.

Edited per the doc-writer skill.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: David Pine <7679720+IEvangelist@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants