How to fix MSB4236The SDK 'Microsoft.NET.Sdk' specified could not be found.

Chris 0 Reputation points
2024-09-27T04:52:34.4766667+00:00

Could not resolve SDK "Microsoft.NET.Sdk". Exactly one of the probing messages below indicates why we could not resolve the SDK. Investigate and resolve that message to correctly specify the SDK.

The NuGetSdkResolver did not resolve this SDK because there was no version specified in the project or global.json.

MSB4276: The default SDK resolver failed to resolve SDK "Microsoft.NET.Sdk" because directory "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Sdks\Microsoft.NET.Sdk\Sdk" did not exist.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,079 questions
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
783 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 30,541 Reputation points Microsoft Vendor
    2024-09-27T06:42:22.6333333+00:00

    Hello @Chris,

    Welcome to Microsoft Q&A forum.

    Please search "Edit the system environment variables" in Windows Search box, click to open it. Click Environment Variables… > in System variables, find Path, select it > click Edit. Find C:\Program Files\dotnet\, on the right, click Move Up to upward it(make sure that it lists higher then C:\Program Files (x86)\dotnet\). Click Ok, reboot your machine, open VS and test again. Or, try to delete the C:\Program Files (x86)\dotnet\ path.

    User's image

    If this doesn’t work, kindly try following:

    1. Manually download and install .NET 8.0 from here: Download .NET 8.0 (SDK 8.0.402|Windows|x64).
    2. Reinstall ".NET desktop development" workload => open VS Installer > Modify > Workloads > uncheck “.NET desktop development” workload > Modify > check it again > Modify.
    3. Open CMD, run dotnet --info, check the information about the installed .NET. Such as the information about the installation path and the global.json file.
    4. Try to repair(VS Installer > More > Repair) and reset VS(run devenv /ResetSettings in "Developer Command Prompt for VS 2022").

    Please also check this similar thread => The SDK Microsoft.NET.Sdk specified could not be found. In Visual Studio Community 2022 version 17.5 .

    Feel free to let us know the results.

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.