Svein Terje Gaup
Svein Terje Gaup

Reputation: 1578

Found .NET SDK, but did not find dotnet.dll

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:

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?

Upvotes: 13

Views: 12446

Answers (2)

Svein Terje Gaup
Svein Terje Gaup

Reputation: 1578

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 Mark wrote below, the folders mentioned reside inside this folder: C:\Program Files\dotnet\sdk

Upvotes: 40

Sateesh Pagolu
Sateesh Pagolu

Reputation: 9606

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

Upvotes: 7

Related Questions