cli-lab icon indicating copy to clipboard operation
cli-lab copied to clipboard

Unable to uninstall SDK preview versions

Open adrianwright109 opened this issue 4 years ago • 6 comments

I have 2 SDKs installed:

  1. Microsoft .NET Core SDK 3.1.300 - preview (x64) from Visual Studio
  2. Microsoft .NET Core SDK 5.0.200-preview.20614.14 (x64) from Visual Studio

If I try to uninstall them using Add or Remove Programs

I get the following errors: imageimage

I have uninstalled the Visual Studio installations which originally installed these SDKs so I'm not able to run the Visual Studio Installer to modify and remove them.

N.B. I would have expected that when I uninstalled the Visual Studio installations which originally installed these SDKs that the SDKs be removed at the same time rather than being orphaned.

I have tried using the dotnet-core-uninstall tool but these SDKs are not listed when running the command: dotnet-core-uninstall list --sdk --x64

The only way I can see that I can remove these SDKs is to re-install the Visual Studio installations that originally installed them to see if I can repair/modify the installations so that I can uninstall the SDKs prior to uninstalling the entire Visual Studio installations again. Unfortunately I don't know which versions of Visual Studio installed these SDKs and even if I did I don't think the old Visual Studio Community Preview versions are still available to download and install.

adrianwright109 avatar Nov 02 '21 12:11 adrianwright109

Yes, the only way to uninstall SDKs that came with Visual Studio is via the VS installer. You said that you uninstalled VS, did you do that via the VS installer? Is the VS installer still on the machine?

@joeloff it seems like VS would uninstall all the SDKs associated with the version of VS being uninstalled, right?

sfoslund avatar Nov 02 '21 16:11 sfoslund

It would. The VS logs would help to tell us whether anything else was installed that referenced the same SDK installers that shipped with VS.

joeloff avatar Nov 02 '21 16:11 joeloff

Yes, the only way to uninstall SDKs that came with Visual Studio is via the VS installer. You said that you uninstalled VS, did you do that via the VS installer?

I would have uninstalled either by the VS installer or via the Windows Add or remove programs (which I imagine would have invoked the VS installer?)

Is the VS installer still on the machine?

I have the VS installer on my machine but it's the latest version for VS2022 not the original version used to install the VS 2019 Previews.

adrianwright109 avatar Nov 02 '21 17:11 adrianwright109

I don't think you can uninstall VS from add/remove programs, so probably through VS installer then? So you have the VS2022 installer on the machine? Any instances of VS? @joeloff do you have instructions for getting the VS logs?

sfoslund avatar Nov 02 '21 17:11 sfoslund

I don't think you can uninstall VS from add/remove programs, so probably through VS installer then?

Yes, I must have used the VS installer then.

So you have the VS2022 installer on the machine?

Yes.

Any instances of VS?

No all VS instances have been uninstalled.

adrianwright109 avatar Nov 02 '21 18:11 adrianwright109

Log collection tool: https://www.microsoft.com/en-us/download/details.aspx?id=12493

@adrianwright109 those two entries in ARP don't actually represent anything. It's just there to let users know when the SDK was installed as part of Visual Studio. It's odd that VS would have left those behind, but if you've removed all the VS instances you can manually remove those installers:

  1. Run reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /d /f "from Visual Studio" /s, you'd see results like this (hopefully)

image

  1. Grab the GUID for each of the MSIs, then run msiexec /x {GUID-you-copied} /q IGNOREDEPENDENCIES=ALL ALLOWMSIUNINSTALL=1 from an admin prompt.

joeloff avatar Nov 03 '21 16:11 joeloff