jmoreno
jmoreno

Reputation: 13571

MSBUILD failing with error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found

I have a net48 SDK project (library), and on my build machine it has suddenly stopped building (and re-running prior commits fail).

Where does MSBuild look for the Microsoft.NET.Sdk for a .net framework (not core) project? I think it may have actually have been deleted, but I can't be sure since I don't know where to check....

Update: server needed updates installed, rebooted and installed updates, and now everything is working again.

Upvotes: 2

Views: 3246

Answers (2)

user541686
user541686

Reputation: 210755

In my case the problem was that the 32-bit dotnet (in %ProgramFiles(x86)%) was coming before the 64-bit one (in %ProgramFiles%). Swapping them fixed the problem.

Upvotes: 2

Jan
Jan

Reputation: 1975

You need dotnet sdk installed on your build machine.

SDK-style projects - even when targeting full FW - need dotnet. See https://learn.microsoft.com/en-us/dotnet/core/project-sdk/overview for more details.

Btw. Binlog viewer and binary MSBuild log (produced via -bl option) is a great tool to troubleshoot your build issues.

Upvotes: 0

Related Questions