skip to Main Content

When I try to right click (in the Solution Explorer) and add the existing project to solution, I get the error:

The .NET Core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path

I checked here (where they get the same error on VS Code) and tried repairing, installing, reinstalling Visual Studio and my .Net 6.0 and 7.0 SDKs. Made sure to install the SDKs even with VS not open, even after a fresh restart. Nothing worked. Plus, some of those solutions seemed specific to VS code, not VS Studio.

Not sure how relevant this detail is, but this my first attempt at installing Visual Studio on this computer.

The problem persisted regardless of project type (WPF and Console were attempted), .Net version (tried making .Net 6.0 and 7.0 apps, which are the 2 sdks I’ve got installed), and whether or not I indicated I wanted the project and solution in the same directory.

Those were my guesses, and nothing’s worked.

Here’s what it looks like when I create a new project:

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    The problem turned out to be that the SDKs weren't ordered correctly in the environment variables. C:Program Files (x86)dotnet was listed before C:Program Filesdotnet. I found the solution here.

    Not exactly a duplicate issue though, as issues were sort of different, but had the same fix.


  2. Open visual studio installer and make sure you have installed .Net Framework Developer correctly.

    enter image description here

    Select .Net 6.0 on this page

    enter image description here

    Can you create a wpf .net 6 project according to this flow.

    enter image description here

    enter image description here

    enter image description here

    enter image description here

    If it still doesn’t work, please try the repair button in the installer.

    enter image description here

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