Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why dotnet --list-sdks does not show installed SDKs on Windows 10?

Tags:

.net-5

I have Microsoft .NET SDK 5.0.102 (x64) installed on my Windows 10, but when I do dotnet --list-sdks nothing shows up? I could see the SDK installed from Windows Apps & features. Thank you.

Edit:

Doing dotnet --info shows the following

$ dotnet --info

Host (useful for support):
  Version: 5.0.2
  Commit:  cb5f173b96

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.9 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.11 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.9 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.11 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.11 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.2 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
like image 477
Ray Avatar asked Jan 12 '21 21:01

Ray


People also ask

How do I know what SDKs I have installed?

Navigate to “Appearance & Behavior” > “System Settings” > “Android SDK” and now you can see the SDK versions that were installed in the “API Level” and “Name” columns (focus on “API Level”).

Where are .NET SDKs installed?

NET are installed to the normal C:\Program Files\dotnet\ folder. However, when you install the x64 version of . NET 6 SDK, it's installed to the C:\Program Files\dotnet\x64\ folder.

How do you check if .NET 5 is installed?

The documented way to check the version is to launch dotnet --info or dotnet --list-runtimes and inspect the results.


4 Answers

Removing c:\Program Files (x86)\dotnet\dotnet.exe from global System Variables Path helps for me.

like image 115
Pavel Zika Avatar answered Oct 26 '22 03:10

Pavel Zika


There are multiple .NET installations on your system and they are getting mixed up.

You have one installation that's x86 (C:\Program Files (x86)) - and has no SDK - and another that's x64 - and has the 5.0.102 SDK.

When you run dotnet, you seem to be running the x86 version.

The SDK you have installed is the x64 version.

You should try and figure out which architecture you need and uninstall the other one.

like image 34
omajid Avatar answered Oct 26 '22 03:10

omajid


CHECK YOUR ENVIRONMENT VARIABLES!

I just ran into this issue and discovered that some how my C:\Program Files (x86)\dotnet\ environment variable was above my C:\Program Files\dotnet\ which meant that whenever I ran the dotnet command it was using the x86 version.

like image 33
ThisWholeDev Avatar answered Oct 26 '22 03:10

ThisWholeDev


See Windows or Visual Studio can't find the latest installed .NET SDK

If the first SDK installed on the machine is a different bit size, you won't see the latest SDK

like image 23
RickAndMSFT Avatar answered Oct 26 '22 04:10

RickAndMSFT