Search code examples
c#asp.net.netvisual-studio-code.net-core

How to fix "No .NET SDKs were found." error--VSCode


I'm trying to setup a backend on my local computer I have installed the v6 dotnet everything is installed but when i run dotnet run I get this error

The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application 'run' does not exist.
  * You intended to execute a .NET SDK command:
      No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet-download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found

dotnet --info

PS C:\Users\Az\bazaar-online\Server\Src\BazaarOnline.API> dotnet --info

global.json file:
  Not found

Host:
  Version:      6.0.7
  Architecture: x86
  Commit:       0ec02c8c96

.NET SDKs installed:
  No SDKs were found.

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

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

I searched a lot but i didn't find anything useful. reinstalled everything tried v3 but didn't fix anything

I have installed these files.

dotnet-hosting-6.0.7-win
dotnet-runtime-6.0.7-win-x64
dotnet-sdk-6.0.302-win-x64

Solution

  • Ok This fixed the problem for me

    I went to the C:\Program Files (x86)\dotnet

    and deleted everthing in the folder

    and than vscode recognized the dotnet sdk.