The Specified SDK "Microsoft.NET.Sdk" was not Found
Asked Answered
S

4

22

So I'm using Rider without Visual Studio installed and its working fine for .NET but for .NET Core I'm getting the error:

Project 'Test2' load failed: Das angegebene SDK "Microsoft.NET.Sdk" wurde nicht gefunden. → (the specified SDK "Microsoft.NET.Sdk" was not found) C:\Users****\RiderProjects\Test2\Test2\Test2.csproj at (0:0)

Project Creating Settings:

img1

The Error when the project is being loaded which fails:

img2

(the blue underline means "the specified SDK "Microsoft.NET.Sdk" was not found")

Rider Toolset and Build Settings:

img3

Installed .Net Core Version:

img4

Rider Version: JetBrains Rider 2018.1.4 Build #RD-181.5550.7

Hope it was detailed enough and you guys can help me to fix this error :)

Shonna answered 10/8, 2018 at 2:55 Comment(0)
G
17

@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

Gauzy answered 10/8, 2018 at 8:29 Comment(6)
There was no MSBuildSDKsPath env. variable so I added it myself and it still does not workShonna
What happens if you select the MSBuild distribution that's inside .NET Core SDK in Rider's Settings > Toolset and Build > Use MSBuild version (the settings page is shown in one of your screenshots)? The MSBuild distribution should be available by a path similar to C:\Program Files\dotnet\sdk\2.1.201\MSBuild.dll.Hochman
Thx! it works now finally.... i selected the path C:\Program Files\dotnet\sdk\2.1.302\MSBuild.dll as MSBuild VersionShonna
Hi! I'm having the exact same issue and this post is the closest I've found to my situation. But nothing here seems to work... Any other ideas ?Lab
@Lab your issue is still exists? if yes, please provide detailsGauzy
Yes it does, and it's the exact same description. I mean, literally every screenshot is correct (apart from the language~). The only difference is that setting MSBuildSDKsPath env var doesn't work for me (either as a system var or user var). I installed everything I could find related to the latest .NET core SDK and runtime but Rider keeps reporting it can't find .Net Core SDKLab
T
14

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

Tenne answered 7/12, 2019 at 12:31 Comment(1)
Works also for Rider 2020. Thank you.Spermato
W
5

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
Weywadt answered 2/3, 2020 at 4:25 Comment(3)
This helped tremendously - thanks for sharing your find! I leveraged this tip to solve a related issue with docker containersRectifier
My case was nearly the same, although I already had the ".NET Core cross-platform development" checked in the Visual Studio 2019 setup. What I was missing, is the very same check in the setup of the "Visual Studio Build Tools 2019". After checking the item there also, the error went away.April
Glad to be of help @BuddyZWeywadt
R
4

I had this same error using the build tools docker container which only installs the azure build tools workload - not the netcore build tools required for Microsoft.Net.Sdk projects.

Solution - Modify dockerfile

The fix for me was to add the Component ID Workload for NetCore Build Tools to the dockerfile config

RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
    --installPath C:\BuildTools `
    --add Microsoft.VisualStudio.Workload.AzureBuildTools `
    # <append the line below>
    --add Microsoft.VisualStudio.Workload.NetCoreBuildTools `
Rectifier answered 3/9, 2020 at 5:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.