The SDK 'Microsoft.NET.SDK' specified could not be found

I have just set up VS 2019, and installed Desktop Development with C++ with the VS Installer.

I also checked all Installation Details, and I installed it. When I created a basic Hello World project and tried to run, I got this error:

'The SDK 'Microsoft.NET.SDK' specified could not be found'

Does anyone know a fix for this? Is there a version mismatch? Or am I missing something?

[Update]
I tried to find the dotnet version, and cmd prompt said the command is not found. Looked in Registry Editor, and I have version 4.0 installed, but it's deprecated.

[Update 2]
Installed dotnet 5.0.202. Still no avail.
Last edited on
closed account (z05DSL3A)
philip9621 wrote:
When I created a basic Hello World project and tried to run, I got this error:

'The SDK 'Microsoft.NET.SDK' specified could not be found'

What project type did you start with?

edit:
and wrote:
I have just set up VS 2019, and installed Desktop Development with C++ with the VS Installer.

I also checked all Installation Details, and I installed it.
you might want to look at unchecking "C++/CLI support for..." unless you specifically need it.

edit 2:
If you want an easy way of seeing what .net SDKs are installed, they are usualy in C:\Program Files\dotnet\sdk\[VERSION]\Sdks where [VERSION] is the .net version number such as 3.1.404
Last edited on
It sounds like your project is trying to use .NET Core for whatever reason. dotnet is within C:\Program Files\dotnet, and you would need to add it to your path to use it outside of Visual Studio.

See also: https://stackoverflow.com/questions/46257393/msbuild-throws-error-the-sdk-microsoft-net-sdk-specified-could-not-be-found

But you might not have to use dotnet to begin with; I don't think you need this for standard C++ development. The .NET version you have would only matter if you're using the Common Language Runtime (as Grey Wolf mentions, C++/CLI support). When you open Visual Studio, create a new project, and choose C++ --> Empty Project as the type. Then add a "main.cpp" or whatever yourself, and build a "hello world" program.
Last edited on
Topic archived. No new replies allowed.