Skip to content

aspire add persists requested version instead of resolved version for unshipped prerelease integrations #17744

@davidfowl

Description

@davidfowl

Description

aspire add records and reports the integration catalog/requested version instead of the NuGet-resolved package version for prerelease integration packages that have not shipped yet.

This showed up while adding a prerelease integration on the 13.4 staging SDK/channel. The integration catalog requested 13.3.5-preview.1.26270.6, but restore resolved the available 13.4 prerelease package 13.4.0-preview.1.26280.4. The command still persisted and printed the stale requested version.

Repro

Starting from a TypeScript AppHost with this scrubbed aspire.config.json shape:

{
  "appHost": {
    "path": "apphost/apphost.mts",
    "language": "typescript/nodejs"
  },
  "sdk": {
    "version": "13.4.0"
  },
  "channel": "staging",
  "packages": {
    "Aspire.Hosting.JavaScript": "13.4.0"
  }
}

Clear the project-local integration restore cache, then add a prerelease integration package that has not shipped yet:

rm -rf .aspire
aspire add <prerelease-integration> --debug --non-interactive

Observed with:

aspire add foundry --debug --non-interactive

CLI version:

13.4.0+56e88661e4d6026cea423827c62c067e11fdf192

Actual behavior

The command prints success for the stale catalog/requested prerelease version:

✅ The package Aspire.Hosting.Foundry::13.3.5-preview.1.26270.6 was added successfully.

aspire.config.json is updated with that same requested version:

"packages": {
  "Aspire.Hosting.JavaScript": "13.4.0",
  "Aspire.Hosting.Foundry": "13.3.5-preview.1.26270.6"
}

However, the debug/restore output shows NuGet resolved the available 13.4 prerelease instead:

WARNING: AspireRestore depends on Aspire.Hosting.Foundry (>= 13.3.5-preview.1.26270.6) but Aspire.Hosting.Foundry 13.3.5-preview.1.26270.6 was not found. Aspire.Hosting.Foundry 13.4.0-preview.1.26280.4 was resolved instead.

The generated integration probe manifest also points at the NuGet-resolved 13.4 prerelease package:

<home>/.aspire/.nugetpackages/<hash>/aspire.hosting.foundry/13.4.0-preview.1.26280.4/lib/net8.0/Aspire.Hosting.Foundry.dll

The debug log confirms the SDK/channel context:

Resolved 'staging' channel: feed=<staging Aspire feed>, quality=Stable, pinnedVersion=(none)
Using SDK version from configuration: 13.4.0

Expected behavior

For prerelease integration packages that have not shipped yet, aspire add should persist and report the NuGet-resolved package version, 13.4.0-preview.1.26280.4 in this run, rather than the stale catalog/requested version 13.3.5-preview.1.26270.6.

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions