The Specified SDK “Microsoft.NET.Sdk” was not Found

前端 未结 4 1051
孤独总比滥情好
孤独总比滥情好 2021-01-04 17:02

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 fai

4条回答
  •  北海茫月
    2021-01-04 18:04

    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.
    3. After the installer finished, VS 2019 could open all projects without issues

提交回复
热议问题