Search code examples
.net-5dotnet-sdk.net-6.0

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:

  • 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?


Solution

  • 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