How to Fix “No .NET SDKs Were Found” on Windows

If you’ve just installed or extracted the latest .NET SDK and run into the error “No .NET SDKs were found”, here’s how to fix it step by step.

Code

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

Don’t panic — this happens because Windows is resolving dotnet.exe from the wrong folder.

dotnet path meme

Why No .NET SDKs were found Error Happens

  • C:\Program Files\dotnet → contains only runtimes (no SDK).
  • Your extracted SDK folder (e.g. Downloads\dotnet-sdk-10.0.300-win-x64) → contains the actual SDK.
  • When you type dotnet, Windows uses the first folder on your PATH. If Program Files\dotnet comes first, you’ll see No .NET SDKs were found.
  • Important for Cursor/VS Code users: Even after updating PATH, these terminals may still prioritize C:\Program Files\dotnet. Setting DOTNET_ROOT alone does not fix this if the wrong dotnet.exe runs first.

✅ Step 1: Check Which Dotnet Is Running

Open PowerShell and run:

powershell

where.exe dotnet

Expected output:

Code

C:\Users\<YourName>\Downloads\dotnet-sdk-10.0.300-win-x64\dotnet.exe
C:\Program Files\dotnet\dotnet.exe

If the first line points to Program Files, that’s the issue.

✅ Step 2: Run Dotnet Directly

Test the extracted SDK:

powershell

& "$env:USERPROFILE\Downloads\dotnet-sdk-10.0.300-win-x64\dotnet.exe" --version
& "$env:USERPROFILE\Downloads\dotnet-sdk-10.0.300-win-x64\dotnet.exe" --list-sdks

You should see:

Code

10.0.300
10.0.300 [C:\Users\<YourName>\Downloads\dotnet-sdk-10.0.300-win-x64\sdk]

✅ Step 3: Fix PATH to Resolve No .NET SDKs Were Found

Option A — Keep in Downloads

powershell

$dotnetRoot = "$env:USERPROFILE\Downloads\dotnet-sdk-10.0.300-win-x64"
[Environment]::SetEnvironmentVariable("DOTNET_ROOT", $dotnetRoot, "User")
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$dotnetRoot;$userPath", "User")

Option B — Move to C:\dotnet

powershell

Move-Item "$env:USERPROFILE\Downloads\dotnet-sdk-10.0.300-win-x64" "C:\dotnet" -Force
[Environment]::SetEnvironmentVariable("DOTNET_ROOT", "C:\dotnet", "User")
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "C:\dotnet;$userPath", "User")

✅ Step 4: Fix the NET SDKs were not found in Cursor/VS Code Terminals

Even after updating PATH, Cursor/VS Code may still load C:\Program Files\dotnet first. To fix this:

Session Fix (paste in terminal)

powershell

$dotnetRoot = "$env:USERPROFILE\Downloads\dotnet-sdk-10.0.300-win-x64"
$env:DOTNET_ROOT = $dotnetRoot
$env:Path = "$dotnetRoot;" + $env:Path

where.exe dotnet
dotnet --version
dotnet --list-sdks

Expected:

Code

First where line: ...\Downloads\dotnet-sdk-10.0.300-win-x64\dotnet.exe
Version: 10.0.300

Permanent Fix Options

  • PowerShell profile (recommended): Add the above block to your profile so every Cursor/VS Code terminal session prepends the SDK path.
  • Run the SDK installer as admin: Installs into C:\Program Files\dotnet\sdk\ so the default dotnet works everywhere.
  • Fully quit Cursor/VS Code: Not just a new tab — restart the app after environment changes.

✅ Step 5: Verify

Close and reopen your terminal, then run:

powershell

dotnet --version
dotnet --list-sdks

Expected:

Code

10.0.300
10.0.300 [C:\dotnet\sdk\10.0.300]

Quick Workaround (Current Session Only)

If you don’t want to change PATH yet:

powershell

$dotnet = "$env:USERPROFILE\Downloads\dotnet-sdk-10.0.300-win-x64\dotnet.exe"
& $dotnet --version
& $dotnet publish -c Release -r win-x64 -o .\packages\win32-storyteller\bin

If SDK Folder Is Missing

If your extracted folder does not contain sdk\, host\, shared\, reinstall properly:

FAQ: Common No .NET SDKs were found Questions

Q: Why does dotnet say “No .NET SDKs were found”? A: Because Windows is resolving dotnet.exe from C:\Program Files\dotnet, which only has runtimes. The SDK folder isn’t first on PATH.

Q: How do I fix PATH for dotnet on Windows? A: Set DOTNET_ROOT to your SDK folder and prepend that folder to your PATH. Restart the terminal, then run dotnet --version.

Q: Why doesn’t DOTNET_ROOT fix it in Cursor/VS Code? A: Because those terminals still run the wrong dotnet.exe first. You must prepend the SDK folder in the session or use a PowerShell profile.

Q: Can I fix dotnet without changing PATH? A: Yes — call the full path to dotnet.exe in your session, e.g.:

powershell

& "C:\dotnet\dotnet.exe" --version

Summary

  • Don’t double‑click dotnet.exe — always run it from a terminal.
  • The error means PATH is pointing to the runtime‑only install in Program Files.
  • Prepend your SDK folder to PATH and set DOTNET_ROOT.
  • For Cursor/VS Code, use a session fix or PowerShell profile to override PATH order.
  • Restart terminal → dotnet --version should now show 10.0.300.

Link to another troubleshooting article: How to Fix net::ERR_CERT_AUTHORITY_INVALID error

Scottshak

Poet. Author. Blogger. Screenwriter. Director. Editor. Software Engineer. Author of "Songs of a Ruin" and "The Convent" and proud owner of four websites and two production houses. Also, one of the geekiest Automation Architect based in Ahmedabad.

You may also like...

Leave a Reply