The SDK 'Microsoft.NET.Sdk' specified could not be found. in Visual Studio Community 2022 version 17.5

Raihanudin Rafif 65 Reputation points
2023-02-28T06:50:12.9966667+00:00

Since Visual Studio 2022 updated from version 17.4 to 17.5, I couldn't load my project. and get the error "The SDK 'Microsoft.NET.Sdk' specified could not be found." But if the project was opened in version 17.4, the project was loaded successfully.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,620 questions
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 27,356 Reputation points Microsoft Vendor
    2023-02-28T13:54:14.22+00:00

    Hello @Raihanudin Rafif ,

    Welcome to Microsoft Q&A forum.

    Please first confirm that .NET SDK has been checked in VS Installer > Modify > Individual components > .NET > .NET SDK. If it isn’t checked, please check it and click Modify.

    Please then create a new .NET based project and check if the same error appears, if the same error appears, please try following to narrow down this issue:

    1. Reboot your machine and restart VS.
    2. Repair Visual Studio from VS Installer > More > Repair.
    3. Reset VS settings(run Developer Command Prompt for Visual Studio 2022 > run devenv /ResetSettings).

    If the same error doesn’t appear, then please try following:

    1. Right-click your project > Unload Project > confirm that the <Project Sdk="Microsoft.NET.Sdk"> line exists > right-click your project again > Reload Project. Open VS Installer > Modify > Individual components > .NET > make sure that .NET SDK has been checked, if not, check it and click Modify.
    2. Remove the hidden .vs, bin and obj folders in your solution/project folder and rebuild your project in VS.

    Please feel free to let us know if this issue disappears.

    Best Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    7 people found this answer helpful.

8 additional answers

Sort by: Most helpful
  1. Ataberk Demir 1 Reputation point
    2023-04-16T02:49:12.3966667+00:00

    Friends, if the problem is that Debug and any cpu are not written on the left side of the exhacute button, and your project does not appear in the solution explorer, the problem is completely related to the sdk not being installed. My advice may fix the problem in the future, but for now you can try "Login to Vistual studio installer from the start, then change and then check all the boxes under the section that says .NET under the arguments heading and try if the problem persists by opening a new project."

    0 comments No comments

  2. moriuse 0 Reputation points
    2023-10-05T13:17:34.0533333+00:00

    If your visual studio is a fresh install, consider installing visual cpp redistributable.

    I have faced this issue and fixed it just by installing visual cpp redistributable.

    0 comments No comments

  3. Ben Kimball 0 Reputation points
    2023-10-18T22:16:49.0766667+00:00

    To fix this (Doesn't make a whole lot of sense, but it worked) was:

    • Open Visual Studio Installer
    • Click Modify
    • Pick Individual Components
    • Scroll all the way down to the bottom
    • Make sure one of the Windows 10 SDKs are installed. (Probably the latest, and probably on Windows 11 you should pick one of the Windows 11 SDKs instead)
    • Let the installer do it's thing
    • When I started VS2022 again, the problem was gone.
    0 comments No comments

  4. Ben Kimball 0 Reputation points
    2023-10-18T22:17:18.81+00:00

    To fix this (Doesn't make a whole lot of sense, but it worked) was:

    • Open Visual Studio Installer
    • Click Modify
    • Pick Individual Components
    • Scroll all the way down to the bottom
    • Make sure one of the Windows 10 SDKs are installed. (Probably the latest, and probably on Windows 11 you should pick one of the Windows 11 SDKs instead)
    • Let the installer do it's thing
    • When I started VS2022 again, the problem was gone.