Fixing the '.NET Core SDK cannot be found: spawn dotnet ENOENT' Error in VS Code

beginner💻 VS Code2026-05-19| Windows, macOS, or Linux; Visual Studio Code with the C# or C# Dev Kit extension.

Error Message

The .NET Core SDK cannot be found: Error running dotnet --info: spawn dotnet ENOENT
#dotnet#vscode#csharp#troubleshooting#omnisharp

Why This HappensYou’re ready to dive into a C# project, but VS Code has other plans. Instead of a working environment, a notification pops up in the bottom right corner claiming the .NET Core SDK is missing. The error looks like this:

The .NET Core SDK cannot be found: Error running dotnet --info: spawn dotnet ENOENT

That cryptic ENOENT tag stands for "Error NO ENTry." Simply put, VS Code tried to run dotnet --info to check your environment but couldn't find the dotnet executable anywhere. This happens even if you just finished the installation five minutes ago.

Step 1: Verify Your InstallationFirst, let's see if the SDK actually exists on your machine. Open your terminal—PowerShell on Windows or Terminal on macOS/Linux—and type:

dotnet --version

If you see a version number like 8.0.204 or 6.0.421, the SDK is there; VS Code is just blind to it. However, if the terminal returns "command not found," you need to grab the installer from the official Microsoft site. Pro tip: Corrupted downloads are a common culprit for failed installs. I usually run the installer's SHA-256 hash through a Hash Generator to compare it against Microsoft's checksum. It's a quick 30-second check that prevents hours of troubleshooting later.

Step 2: Update the System PATHVS Code relies on the system PATH to locate tools. If the installer didn't update your PATH correctly, or if you haven't restarted your shell, the dotnet command won't be recognized globally.

Windows Instructions:- Hit the Windows key and type "Environment Variables".- Select Edit the system environment variables.- Click Environment Variables at the bottom.- Look for the Path variable under System variables and click Edit.- Check for C:\Program Files\dotnet\. If it’s missing, add it manually.### macOS and Linux:Your shell needs to know where the dotnet binary lives. Usually, this is /usr/local/share/dotnet. Check your .zshrc or .bashrc file and make sure the path is exported correctly.

Step 3: Point the Extension Directly to the SDKSometimes the system PATH is fine, but the C# extension remains stubborn. You can bypass the search by telling the extension exactly where the executable lives.

  • Press Ctrl + , (or Cmd + , on Mac) to open Settings.- Search for dotnetPath.- Locate the Dotnet: Dotnet Path (or Omnisharp: Dotnet Path) field.- Enter the full path to your executable.On Windows, use: C:\Program Files\dotnet\dotnet.exeOn macOS/Linux, use: /usr/local/share/dotnet/dotnet

Step 4: Resolve Architecture Mismatches (Apple Silicon)M1, M2, and M3 Mac users often hit this wall because of architecture conflicts. If you have the x64 SDK installed but are running the ARM64 version of VS Code (or vice versa), the extension might struggle to bridge the gap. Run which dotnet in your terminal. If it points to /usr/local/bin/dotnet, ensure you haven't accidentally installed the Intel version of the SDK on your Silicon Mac.

Step 5: The Full RestartEnvironment variables are notoriously sticky. They often don't refresh until the parent process restarts. Don't just reload the window; follow this sequence:

  • Close every single instance of VS Code.- Quit your terminal application.- Restart VS Code.- Check the Output window (select C# or OmniSharp Log from the dropdown) to confirm the SDK initialized.## The Final TestSuccess looks like a clean UI with no popups. To be certain, open the VS Code integrated terminal and run dotnet --info. If the details of your SDK appear and your IntelliSense starts suggesting code, you've officially beaten the ENOENT error.

Quick Takeaways- ENOENT = Missing Path: It's almost always a mapping issue, not a broken SDK.- Restarts are mandatory: New PATH settings rarely take effect until you restart the app.- Manual overrides work: When the system PATH fails, the dotnetPath setting in VS Code is your best friend.

Related Error Notes