dotnet / dotnet/sdk

Empty package ID in message when running `dotnet tool update -g --all` with up-to-date packages

Open
#43,158 6 comments 0 reactions 1 assignee Claimed by @baronfel View on GitHub
Area-Tools untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Describe the bug
When running `dotnet tool update -g --all` and some packages are already up to date, the message prints an empty ID.

> Tool '' is already installed.

This is a follow-up issue blocked by #42598. That issue must be addressed before the problematic code path for this issue can be reached.

### To Reproduce

(Assuming #42598 already fixed)
1. Install any global dotnet tool. For example: `dotnet tool install csharprepl -g`
2. Immediately perform full global tools update: `dotnet tool update -g --all`
3. Observe that the CLI prints a message with an empty package ID in it

### Exceptions (if any)
Not applicable

### Analysis
This is caused by a new [optimization](https://github.com/dotnet/sdk/blob/f271b05d65e8218d3c276f417d66021692108118/src/Cli/dotnet/commands/dotnet-tool/install/ToolInstallGlobalOrToolPathCommand.cs#L165) where up-to-date packages are no longer reinstalled, introduced by 4a4823d8b9f0f7b3610f47af4ddda82edb6a21e2. The newly added message is formatted with the package ID supplied in the command line, which would be null if `--all` is supplied.

### Further technical details
- Include the output of `dotnet --info`
This is locally produced build from main branch.


.NET SDK:
Version: 10.0.100-dev
Commit: f271b05d65
Workload version: 10.0.100-manifests.2316105a
MSBuild version: 17.12.0-preview-24407-03+6bc91d5e2

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22635
OS Platform: Windows
RID: win-x64
Base Path: E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\sdk\10.0.100-dev\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
[aspire]
Installation Source: VS 17.11.35222.181, VS 17.12.35209.166
Manifest Version: 8.0.1/8.0.100
Manifest Path: E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.1\WorkloadManifest.json
Install Type: FileBased

Host:
Version: 9.0.0-rc.1.24414.5
Architecture: x64
Commit: static

.NET SDKs installed:
10.0.100-dev [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.0-preview.7.24406.2 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-rc.1.24414.4 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-preview.7.24405.7 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-rc.1.24412.13 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-rc.1.24414.5 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 9.0.0-preview.7.24405.2 [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
DOTNET_ROOT [E:\dotnet-sdk\artifacts\bin\redist\Debug\dotnet]

global.json file:
Not found

- The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
CLI is capable of reproduction, no IDE required.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.