`aspire update --self` doesn't update `.config/dotnet-tools.json`
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
`aspire update --self` updates the standalone CLI binary but does not update the `aspire.cli` version in `.config/dotnet-tools.json`. This creates version drift between the running CLI and the version declared in the tool manifest checked into source control.
Additionally, `dotnet aspire update --self` only prints a hint to run `dotnet tool update -g Aspire.Cli` (global install) — it doesn't account for **local** tool manifest installs either.
Neither code path updates `.config/dotnet-tools.json`.
### Expected Behavior
When `aspire update --self` runs (regardless of install mechanism — standalone CLI or `dotnet tool`), it should:
1. Update the CLI binary (already works for standalone)
2. **Also update `.config/dotnet-tools.json`** if a local tool manifest exists with an `aspire.cli` entry, so the declared version matches the running version
3. When invoked via `dotnet aspire update --self`, detect whether the tool is installed locally (manifest) vs globally and run the appropriate `dotnet tool update` command — not just suggest the global flag
The tool manifest is checked into source control and serves as a version contract for the team. If `aspire update --self` doesn't update it, other developers cloning the repo get a stale pinned version (masked at runtime only if `rollForward: true` is set).
### Steps To Reproduce
**Before:**
```json
// .config/dotnet-tools.json
{
"tools": {
"aspire.cli": {
"version": "13.3.0-preview.1.26156.8",
"commands": ["aspire"],
"rollForward": true
}
}
}
```
**Commands tested:**
| Command | Behavior | Updates dotnet-tools.json? |
|---------|----------|--------------------------|
| `aspire update --self --channel daily --non-interactive` | Updates standalone binary at `~/.aspire/bin/aspire` | **No** |
| `dotnet aspire update` | "Project is up to date!" | **No** |
| `dotnet aspire update --self` | Prints: "run `dotnet tool update -g Aspire.Cli`" | **No** |
**After `aspire update --self --channel daily --non-interactive`:**
```
$ aspire --version
13.3.0-preview.1.26163.4+8aba30e0f288ebeee09e7322732e3ee917aaea39
```
```json
// .config/dotnet-tools.json — UNCHANGED
{
"tools": {
"aspire.cli": {
"version": "13.3.0-preview.1.26156.8"
}
}
}
```
### Exceptions (if any)
_No response_
### .NET Version info
```
.NET SDK:
Version: 10.0.103
Commit: c2435c3e0f
Workload version: 10.0.102
MSBuild version: 18.0.11+c2435c3e0
Runtime Environment:
OS Name: ubuntu
OS Version: 24.04
OS Platform: Linux
RID: linux-x64
Base Path: /home/elan/.local/share/dnvm/dn/sdk/10.0.103/
Host:
Version: 10.0.3
Architecture: x64
Commit: c2435c3e0f
.NET SDKs installed:
8.0.418 [/home/elan/.local/share/dnvm/dn/sdk]
10.0.100 [/home/elan/.local/share/dnvm/dn/sdk]
10.0.103 [/home/elan/.local/share/dnvm/dn/sdk]
```
### Anything else?
- Aspire CLI version: `13.3.0-preview.1.26163.4+8aba30e0f288ebeee09e7322732e3ee917aaea39` (daily)
- IDE: Claude Code 2.1.76
- Platform: Linux (WSL2, Ubuntu 24.04)
Related: #15253 (`aspire update --self --non-interactive` fails without `--channel`)
Contributor guide
Research direction
Start with the self-update paths for `aspire update --self` and `dotnet aspire update --self`, then inspect how `.config/dotnet-tools.json` and `aspire.cli` entries are handled. Reproduce the standalone and dotnet-tool cases from the issue; the work is done when the appropriate local or global update occurs and the manifest version matches the running CLI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100