1

I have Visual Studio 2019 16.8.3 installed (upgrading from 16.8.2).

After the upgrade, I could not open any .NET Core related project, as I had the following error:

The project file cannot be opened. Unable to locate the .NET SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.

So I decided to install the .Net Core 3.1 SDK and .Net 5 SDK separately.

After the successful install, I still don't have any SDK installed.

enter image description here

enter image description here

enter image description here

What should I do about this (other than VS full repair)?

Nestor
  • 8,194
  • 7
  • 77
  • 156
  • See https://stackoverflow.com/questions/67049414/windows-or-visual-studio-cant-find-the-latest-installed-net-sdk which is more complete – RickAndMSFT Apr 27 '22 at 00:18

1 Answers1

11

According to this very good article, x64 and x86 versions of the SDK can't be active the same time:

The problem here is that if you have both 32 bit and 64 bit versions of the SDK installed, the first one found wins. And only one version of the SDK (32 bit or 64 bit) can be active at any one time.

It seems that Windows and Visual Studio choose SDK version by throwing a dice which one is found first...

SO, I solved it by moving the x64 directory a level up in the PATH environment variable and now everything works

enter image description here

Nestor
  • 8,194
  • 7
  • 77
  • 156