skip to Main Content

I’m trying to use the C# Dev Kit extension for Visual Studio Code for my project.
I’ve created two ASP.NET Core Web API projects.

They can both be built successfully.
However, when my workspace is loaded, the Solution Explorer will give an error for each project: A compatible .NET SDK was not found.

Looking at the output window, it looks like it found the SDK and I’m also able to built both projects just fine.
It looks like it’s just an issue with the Solution Explorer.

I’ve also tried to add different project types (Class Library, Console App) but they all give the same error.

Anyone know what the problem is here?

Here is a screenshot of what I’m looking at:

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    This is only an issue on Mac OS.

    I was using Homebrew to install the .NET Core SDK.
    Due to some issue, the VS Code extension was therefore not able to properly locate the SDK.

    After uninstalling the SDK using Homebrew, I re-installed it using the .pkg package from Microsoft and that worked.


  2. This seems to be this bug: [BUG] "A compatible .NET SDK was not found" when opening workspace #120.

    A fix has been released for that issue in pre-release v0.2.70. Try that out and see if that fixes your issue (source).

    If the fix doesn’t work for you and you’re on macOS, some macOS users have said that uninstalling the HomeBrew version of dotnet and installing using the pkg file resolved their issue (source).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search