The Specified SDK "Microsoft.NET.Sdk" was not Found

@alphaaxmet

You're using a custom MSBuild version

Check your MSBuildSDKsPath env. variable, it should be equal to the path with your latest .net core sdk , e.g.: C:\Program Files\dotnet\sdk\2.1.302


I was getting this error when trying to load projects targetting .NET core (Project Sdk property Microsoft.NET.Sdk). My environment at the time of this issue was as follows:

  1. .NET Core SDK 2.1.103 through 3.1.102 installed
  2. JetBrains Rider 2019.3.4 installed
  3. Visual Studio 2019 Professional 16.4.5 installed

Rider was able to open the project and solution absolutely fine, although VS 2019 kept complaining about missing SDK. This was a solution with 2 projects both with SDK as Microsoft.NET.Sdk. I then opened a solution that had a web project in it in VS 2019 i.e. Microsoft.NET.Sdk.Web. VS 2019 showed a prompt that said that I needed additional workloads to be installed. When I clicked ok, VS Installer launched and automatically selected "ASP.NET and web development" under workloads. After the installation finished, the web project opened fine but the project with Microsoft.NET.Sdk as the SDK continued to complain about missing SDK.

On further research, I came across this github issue where @akshita31 recommended installing .NET core build tools. Following this:

  1. I relaunched VS 2019 installer
  2. Looked under "Other Toolsets" (scroll at the bottom of the installer Workloads tab) and checked ".NET Core cross-platform development" and followed through. Visual Studio Installer
  3. After the installer finished, VS 2019 could open all projects without issues

Thanks to @Damir Beylkhanov 's and @Jura Gorohovsky 's answer, If you are experiencing The Specified SDK “Microsoft.NET.Sdk” was not Found error and you have installed JetBrains Rider 2019 or JetBrains Rider 2020 and Dot NET Core 3.1 on Windows 10 64 bit, see below instructions on How to Fix that;

You will need to use the MSBuild that comes with Dot NET Core 3.1 instead of the one that is provided by your installed Dot NET Runtime 3.x or 4.x

So here is how to locate and add the MSBuild that is needed for your Rider Jetbreains IDE if you are using Dot NET Core 3.1.

I was working with a Windows 10 64 bit OS and JetBrains Rider 2019.2.3 I do not know if this is How it works for other Windows platforms or previous versions of JetBrains Rider.

For 64 bit based Windows 10, after you install Dot NET Core 3.1 , your MSBuild.dll will be in this path C:\Program Files\dotnet\sdk\3.1.100

You may also consider adding the path C:\Program Files\dotnet\sdk\3.1.100 to your environment variables.

So here is How to do it.

  1. Click ToolsSettings in JetBrains Rider 2019.2.3

  2. Scroll down and locate Build, Execution, Deployment click on it to expand it.

  3. Scroll down and locate Toolset and Build then click on it to open it.

  4. Once you have opened Toolset and Build, find below the option for editing Use MSBuild version and click the Custom button to the right to browse for the MS Build you want to use.

  5. Browse to the path where your Dot NET Core 3.1 is installed and select the MSBuild dll file there. In my case it was this path C:\Program Files\dotnet\sdk\3.1.100.

  6. Once you have selected the MSBuild.dll that installed with your Dot NET Core 3.1, click OK and OK any other open windows then run your Project again. It should work fine now.

See below screenshot for where circled in red to follow through the same process as I did it on my JetBrains Rider IDE. The same screenshot herein also shows the path for MSBuild.dll in my Windows Desktop Computer.

enter image description here