Visual Studio is unable to locate the .NET.Core SDK when it runs an Xamarin App

Viewed 2181

Every time when I run a Xamarin App from Visual Studio, I get the Error message below:

Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.

enter image description here

2 Answers

Open your console and run

dotnet --list-sdks

To make sure you have the proper SDKs installed. Then follow the microsoft resolution

Ways to work around this:

  • Install .NET Core SDK from https://dotnet.microsoft.com/download.

  • Don't use global.json. I would be happy to hear why you chose to use it.

  • Include a roll forward indicator such as the following which will ensure running with any SDK higher than 3.1.100

{
  "sdk": {
    "version": "3.1.100",
    "rollForward": "latestMajor"
  }
}

adding in appsettings.json, add below tag with your version:

"sdk": {
    "version": "3.1.402",
    "rollForward": "latestMajor"
},

restart VS, opened project without the subject issue.

Related