The other day I opened up Visual Studio solution consisting of a number of projects written in NET Core. To my surprise, none of the projects loaded and I wasn’t able to see, let alone write, any code in these projects.

Where are my NET Core SDKs?

Initially I wasn’t sure where to start troubleshooting this. I knew the solution stack, so I opened Powershell to find out what frameworks I had installed on my machine.

dotnet --info

The output was:

Host (useful for support):
  Version: 5.0.5
  Commit:  2f740adc14

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.14 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]        
  Microsoft.AspNetCore.App 5.0.5 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.14 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.5 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.14 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.5 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App] 

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

The Problem

The problem is due to x86 (32 bit) versus x64 (64 bit) architecture and file system and folders where the framework lives.

On x86 – 32 bit architecture your framework is located in:

C:\Program Files (x86)\dotnet

On x64 – 64 bit architecture your framework is located in:

C:\Program Files\dotnet

The Solution

If you are running 32 bit OS, then make sure your framework files are located in the C:\Program Files (x86)\dotnet folder. And the C:\Program Files\dotnet should be EMPTY.

The opposite is true for 64 bit OS, so make sure your framework files are located in the C:\Program Files\dotnet folder. And the C:\Program Files (x86)\dotnet should be EMPTY.

NET Core SDKs are back

I run 64 bit OS, so I went to C:\Program Files (x86)\dotnet, emptied its contents and when I ran the dotnet –info command in Powershell again, bingo – my NET Core SDKs came back.

.NET SDK (reflecting any global.json):
Version:   5.0.202     
 Commit:    db7cc87d51  

Runtime Environment:    
 OS Name:     Windows   
 OS Version:  10.0.19042
OS Platform: Windows   
 RID:         win10-x64
Base Path:   C:\Program Files\dotnet\sdk\5.0.202\

Host (useful for support):
  Version: 5.0.5
  Commit:  2f740adc14

.NET SDKs installed:
  2.1.520 [C:\Program Files\dotnet\sdk]
  3.1.100 [C:\Program Files\dotnet\sdk]
  3.1.114 [C:\Program Files\dotnet\sdk]
  3.1.408 [C:\Program Files\dotnet\sdk]
  5.0.202 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]        
  Microsoft.AspNetCore.App 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]        
  Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]        
  Microsoft.AspNetCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] 
  Microsoft.WindowsDesktop.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] 
  Microsoft.WindowsDesktop.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] 

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
Marcin Narloch

Marcin Narloch

Creative and out-of-the-box thinker with strong interests and knowledge in technology and innovation.
Reset Git Branch Commits Previous post Reset Git Branch Commits
Powershell Policies Next post Amending Powershell Execution Policies

Leave a Reply

Your email address will not be published. Required fields are marked *