Fix it fast
Most likely: MSBuild cannot find the SDK named in the project file because the required .NET SDK is not installed, global.json pins a missing SDK, or the wrong MSBuild executable is being used.
1. Confirm this is your error
error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found. 2. Check the cause
dotnet --info
dotnet --list-sdks
cat global.json
grep -n "<Project Sdk=" *.csproj 3. Apply the safe fix
# Install the SDK version required by global.json or update global.json to an installed SDK.
dotnet --list-sdks
dotnet build
# If msbuild.exe fails but dotnet build works, use dotnet build in CI or install a compatible Visual Studio/MSBuild toolset.
dotnet build 4. Verify it works
dotnet --version
dotnet build Don't use unsafe shortcuts
- Do not edit
<Project Sdk="Microsoft.NET.Sdk">unless the project truly uses a different SDK. - Do not assume Visual Studio MSBuild and
dotnet buildresolve SDKs the same way. - Do not leave
global.jsonpinned to an SDK that CI does not install.
What Broke in the Build
MSBuild could not resolve the project SDK, such as Microsoft.NET.Sdk, because the required .NET SDK or SDK resolver is unavailable.
Fix the underlying build failure
Confirm SDK availability with dotnet --info, install the required SDK, or update global.json, then rerun dotnet build, and if you are using msbuild.exe directly, prefer dotnet build or ensure the MSBuild instance supports SDK-style projects.
Prove the Build Path Is Clean
Build succeeds without MSB4236.
Logs show the intended SDK version and resolver path.
Validation
Re-run the failing command and confirm the original code/message is gone, and confirm expected artifacts or outputs exist (packages restored, build/publish succeeds).
Why the Build Fails
Usually this comes down to the .NET SDK is not installed, or the wrong MSBuild instance is being used, global.json pins an SDK that isn’t installed, or SDK resolution fails due to feed or network problems.
Mechanism
This is the part worth understanding if the quick fix did not hold. It explains what .NET is trying to do at the moment the error appears.
SDK-style projects declare <Project Sdk="...">.
MSBuild uses SDK resolvers, including the installed .NET SDK and NuGet-delivered SDKs, if resolution fails, MSB4236 is emitted.
Keep Build Prerequisites Consistent
To prevent this, standardize CI builds on dotnet build, and pin SDK versions intentionally and ensure CI installs them explicitly.