11

I recently installed Visual Studio 2022 preview.

Today I was in a workshop and there was some feature that didn't work, and it turned out it was because I had the preview version of .NET 6 installed.

So I then uninstalled Visual Studio 2022 preview.

Now, when I type dotnet --version (or other command like dotnet --info) in a command window, I get the following message:

  • Found .NET SDK, but did not find dotnet.dll at [C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\dotnet.dll]

I have tried to repair, and then reinstall DotNet SDK 5.0.400. Restarted machine a few times as well, to no avail.

I am guessing the uninstaller removed the files, but failed to restore the registry to the previous version.

How do I fix this?

Svein Terje Gaup
  • 1,424
  • 15
  • 29

2 Answers2

31

So right after posting my question, I discovered that the uninstaller had left some leftovers on my disk. There was a folder with some files, called 6.0.100-preview.7.21379.14. After I deleted it, the command "dotnet --version" now returns "5.0.400".

As Mak wrote below, the folders mentioned reside inside this folder: C:\Program Files\dotnet\sdk

Svein Terje Gaup
  • 1,424
  • 15
  • 29
  • 4
    phew thanks, I was already starting to panic when a reboot didn't fix it (I miss old Windows).. Maybe it's good to mention that those folders reside in C:\Program Files\dotnet\sdk – Mark Jul 21 '22 at 17:50
6

I also ran into the same problem recently. I had to go to the below path in Windows and delete all 6.*.* folders.

C:\Program Files\dotnet
Sateesh Pagolu
  • 9,282
  • 2
  • 30
  • 48