aspire add persists requested version instead of resolved version for unshipped prerelease integrations
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
## 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:
```json
{
"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:
```bash
rm -rf .aspire
aspire add --debug --non-interactive
```
Observed with:
```bash
aspire add foundry --debug --non-interactive
```
CLI version:
```text
13.4.0+56e88661e4d6026cea423827c62c067e11fdf192
```
## Actual behavior
The command prints success for the stale catalog/requested prerelease version:
```text
✅ 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:
```json
"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:
```text
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:
```text
/.aspire/.nugetpackages//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:
```text
Resolved 'staging' channel: 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`.
Contributor guide
Assessment
This issue has not been assessed yet.