sdk icon indicating copy to clipboard operation
sdk copied to clipboard

`dotnet workload uninstall` cannot find workload returned by `dotnet workload list`

Open ReubenBond opened this issue 1 year ago • 7 comments

Describe the bug

I want to uninstall a workload which dotnet workload list says I have installed, but dotnet workload uninstall says that workload id could not be found.

To Reproduce

I cannot uninstall this workload since it cannot be found:

> dotnet workload uninstall maui-windows

Workload uninstallation failed: Couldn't find workload ID(s): maui-windows

... but if I list installed workloads, it's here:

> dotnet workload list

Installed Workload Id      Manifest Version                      Installation Source
------------------------------------------------------------------------------------------------
aspire                     8.1.0-preview.1.24251.12/8.0.100      SDK 8.0.200, VS 17.11.34901.157
android                    34.0.94/8.0.200                       VS 17.11.34901.157
maccatalyst                17.2.8062/8.0.100                     VS 17.11.34901.157
maui-windows               8.0.21/8.0.100                        VS 17.11.34901.157
ios                        17.2.8062/8.0.100                     VS 17.11.34901.157

Use `dotnet workload search` to find additional workloads to install.

I would guess the issue is related to the installation source being VS. Perhaps the output should explain that I need to uninstall the workload from the VS installer, if that's the case.

Further technical details

dotnet --info
dotnet --info
.NET SDK:
 Version:           8.0.204
 Commit:            c338c7548c
 Workload version:  8.0.200-manifests.36aa5852

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22631
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.204\

.NET workloads installed:
 [aspire]
   Installation Source: SDK 8.0.200, VS 17.11.34901.157
   Manifest Version:    8.1.0-preview.1.24204.10/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.1.0-preview.1.24204.10\WorkloadManifest.json
   Install Type:        FileBased

 [android]
   Installation Source: VS 17.11.34901.157
   Manifest Version:    34.0.94/8.0.200
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.200\microsoft.net.sdk.android\34.0.94\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: VS 17.11.34901.157
   Manifest Version:    17.2.8053/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.2.8053\WorkloadManifest.json
   Install Type:        FileBased

 [maui-windows]
   Installation Source: VS 17.11.34901.157
   Manifest Version:    8.0.21/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.21\WorkloadManifest.json
   Install Type:        FileBased

 [ios]
   Installation Source: VS 17.11.34901.157
   Manifest Version:    17.2.8053/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8053\WorkloadManifest.json
   Install Type:        FileBased


Host:
  Version:      9.0.0-preview.4.24204.3
  Architecture: x64
  Commit:       ffb257818d

.NET SDKs installed:
  6.0.421 [C:\Program Files\dotnet\sdk]
  7.0.408 [C:\Program Files\dotnet\sdk]
  8.0.204 [C:\Program Files\dotnet\sdk]
  8.0.300-preview.0.24216.11 [C:\Program Files\dotnet\sdk]
  8.0.300-preview.24203.14 [C:\Program Files\dotnet\sdk]
  9.0.100-preview.4.24207.3 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0-preview.4.24205.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0-preview.4.24204.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.29 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.18 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0-preview.4.24204.1 [C:\Program Files\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:
  Not set

global.json file:
  C:\dev\aspire\global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

ReubenBond avatar May 02 '24 15:05 ReubenBond

'I would guess the issue is related to the installation source being VS. Perhaps the output should explain that I need to uninstall the workload from the VS installer, if that's the case.'

That is correct! And yes we should have really added that some time ago.

nagilson avatar May 02 '24 22:05 nagilson

I've now hit this again today myself. I think this is valuable to improve.

danmoseley avatar May 03 '24 02:05 danmoseley

I've hit this also. I am trying to remove MAUI to get the newest version so I can install the CommunityToolkit.MAUI. However, I uninstalled via VS2022 and it shows MAUI workload is not loaded but when I use the "dotnet workload list" command it shows them still loaded. When I use "dotnet workload uninstall maui-windows" it says it can't find it. How can I uninstall so that I can then install the latest? I've tried the update but it doesn't work. It shows 8.0.7/8.0.100 as the Manifest version. I have tried getting the new SDK and it shows I am at 8.0.4 (did this because of https://github.com/dotnet/maui/issues/20600).

cfoster7023 avatar May 06 '24 21:05 cfoster7023

This hit @stephentoub as well - we should target this for 8.0.400.

baronfel avatar May 10 '24 14:05 baronfel

Our new hire is no more -- let's figure out who is going to do this

nagilson avatar May 20 '24 18:05 nagilson

This is the case of workloads installed by VS. The experience should provide a more helpful error message.

marcpopMSFT avatar May 21 '24 20:05 marcpopMSFT

Related to workload installation, I seem to be neither able to install or uninstall aspire at the moment: image

Strangely I don't seem to have the manifests for this version of the SDK: image

Does anybody have any advice here?

RichardWhitfield avatar Jul 01 '24 08:07 RichardWhitfield

Still getting this :(

Image

WeihanLi avatar Dec 06 '24 16:12 WeihanLi

same here

doroudi avatar Dec 08 '24 04:12 doroudi