Arcade: Unable to locate the .NET Core SDK

Created on 12 Jun 2019  Â·  11Comments  Â·  Source: dotnet/arcade

Using Arcade 1.0.0-beta.19272.13. Attempting to build I get:
%userprofile%.nuget\packages\microsoft.dotnet.arcade.sdk1.0.0-beta.19272.13tools\Tools.proj : error : Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches th
e installed version.
%userprofile%.nuget\packages\microsoft.dotnet.arcade.sdk1.0.0-beta.19272.13tools\Tools.proj : error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

However this is my global.json:
"tools": {
"dotnet": "3.0.100-preview5-011568",
"runtimes": {
"dotnet/x64": [
"2.1.7"
]
}

And these are the dotnet sdks I have installed:
dotnet --list-sdks
1.1.14 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.302 [C:\Program Files\dotnet\sdk]
2.1.507 [C:\Program Files\dotnet\sdk]
2.1.602 [C:\Program Files\dotnet\sdk]
2.1.700 [C:\Program Files\dotnet\sdk]
2.2.101 [C:\Program Files\dotnet\sdk]
2.2.202 [C:\Program Files\dotnet\sdk]
2.2.300 [C:\Program Files\dotnet\sdk]
3.0.100-preview5-011568 [C:\Program Files\dotnet\sdk]

Adding this env var makes it work:
set DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR=C:\Program Files\dotnet\sdk\3.0.100-preview5-011568\Sdks

Most helpful comment

I had this issue on the current 16.3 Visual Studio update (.net core 3.0 release version)... I fixed it by adding C:\Program Files\dotnet to my PATH variable, looks like it gets messed up somehow

All 11 comments

Is this a command line build with build.cmd? Or from VS?
What happens if you add "sdk": { "version": "3.0.100-preview5-011568" } into your global.json?

This is with build.cmd.

Adding the sdk doesn’t seem to help:

{
"tools": {
"dotnet": "3.0.100-preview5-011568",
"runtimes": {
"dotnet/x64": [
"2.1.7"
]
},
"vs": {
"version": "16.0"
}
},
"msbuild-sdks": {
"Microsoft.Build.CentralPackageVersions": "2.0.1",
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19272.13"
},
"sdk": { "version": "3.0.100-preview5-011568" }
}

Thanks!

-M

From: Alex Perovich notifications@github.com
Sent: Wednesday, June 12, 2019 2:25 PM
To: dotnet/arcade arcade@noreply.github.com
Cc: Matt Neely Matthew.Neely@microsoft.com; Author author@noreply.github.com
Subject: Re: [dotnet/arcade] Unable to locate the .NET Core SDK (#3035)

Is this a command line build with build.cmd? Or from VS?
What happens if you add "sdk": { "version": "3.0.100-preview5-011568" } into your global.json?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Farcade%2Fissues%2F3035%3Femail_source%3Dnotifications%26email_token%3DAL3NH7DVZE2UC6NBTOLUK4LP2FSTNA5CNFSM4HXSJRH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXR27TI%23issuecomment-501460941&data=02%7C01%7CMatthew.Neely%40microsoft.com%7Cfb52ea169714475d868108d6ef7c7324%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636959715120548635&sdata=Qwls93J8JYd6oUo2W%2BqRNKGru%2BJDOolkz1VQkUBMews%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAL3NH7BM3JNJSQ4ZFMA7WATP2FSTNANCNFSM4HXSJRHQ&data=02%7C01%7CMatthew.Neely%40microsoft.com%7Cfb52ea169714475d868108d6ef7c7324%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636959715120548635&sdata=KSKE%2FtFFg4nsimRgrY9GC%2BwtBGRQoMwPPPRdiu7PHWA%3D&reserved=0.

Oooo, I have seen this problem before with the vs msbuild installation that you are telling arcade to use. I think you need to have VS 16 preview installed for it to work with 3.0. If you have that already installed can you run build.cmd from a dev cmd prompt for that VS?

Building from a VS2019 command prompt results in the same errors:
error : 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.
error MSB4236: The SDK 'Microsoft.NET.Sdk' specified could not be found.

And it is using the 2019 msbuild:
C:>where MSBuild.exe
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
%userprofile%\Downloads\MSBuild\MSBuild15.0\Bin\MSBuild.exe

C:> msbuild -version
Microsoft (R) Build Engine version 16.1.76+g14b0a930a7 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

16.1.76.45076

Thanks.

-M

From: Alex Perovich notifications@github.com
Sent: Thursday, June 13, 2019 1:35 PM
To: dotnet/arcade arcade@noreply.github.com
Cc: Matt Neely Matthew.Neely@microsoft.com; Author author@noreply.github.com
Subject: Re: [dotnet/arcade] Unable to locate the .NET Core SDK (#3035)

Oooo, I have seen this problem before with the vs msbuild installation that you are telling arcade to use. I think you need to have VS 16 preview installed for it to work with 3.0. If you have that already installed can you run build.cmd from a dev cmd prompt for that VS?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Farcade%2Fissues%2F3035%3Femail_source%3Dnotifications%26email_token%3DAL3NH7DXPP3SOVK6KQ6PPNLP2KVOLA5CNFSM4HXSJRH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXU6QLY%23issuecomment-501868591&data=02%7C01%7CMatthew.Neely%40microsoft.com%7Cc3ebc89dea094411985c08d6f03e92e0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636960548872798501&sdata=%2FrxxzE33Dl9hNDEHNxvbiVsMGg%2FnZr%2FsOt%2FZSA%2BrNhg%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAL3NH7B4KXXHBFKMI363FTLP2KVOLANCNFSM4HXSJRHQ&data=02%7C01%7CMatthew.Neely%40microsoft.com%7Cc3ebc89dea094411985c08d6f03e92e0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636960548872798501&sdata=nNIbzAjgRBMRTf10aVrMugZpzJa%2FJu0wVEi%2FR1%2Bxfy0%3D&reserved=0.

I'm out of ideas. A binlog might have some useful information about the sdk resolver process. Can you gather a binlog? If that doesn't have anything useful in it then this is a problem somewhere in the guts of msbuild. @rainersigwald might be able to help.

Are you running a released version of Visual Studio, or prereleases? There is a checkbox in the released versions that prevents resolving prerelease versions of the .NET Core SDK, under Tools -> Options:

image

Since the .NET Core 3.0 SDK is in a prerelease state, it's not officialy supported by release Visual Studio, and the SDK team recommends using preview Visual Studios for projects that use preview SDKs.

Is that relevant when building from the command-line?

(Also, Outlooks seems to have butchered your linked image below.)

Thx.

-M

From: Rainer Sigwald notifications@github.com
Sent: Monday, June 17, 2019 8:01 AM
To: dotnet/arcade arcade@noreply.github.com
Cc: Matt Neely Matthew.Neely@microsoft.com; Author author@noreply.github.com
Subject: Re: [dotnet/arcade] Unable to locate the .NET Core SDK (#3035)

Are you running a released version of Visual Studio, or prereleases? There is a checkbox in the released versions that prevents resolving prerelease versions of the .NET Core SDK, under Tools -> Options:

[Image removed by sender. image]https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F3347530%2F59614580-a795c900-90e6-11e9-8981-0fdbd08d42bd.png&data=02%7C01%7CMatthew.Neely%40microsoft.com%7C459590369e474de9dd7d08d6f334aa16%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636963804852091885&sdata=QkhPKA30XBFOmOFxgskRM%2F9LKLNfcqzQkjZwI6eCJqw%3D&reserved=0

Since the .NET Core 3.0 SDK is in a prerelease state, it's not officialy supported by release Visual Studio, and the SDK team recommends using preview Visual Studios for projects that use preview SDKs.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Farcade%2Fissues%2F3035%3Femail_source%3Dnotifications%26email_token%3DAL3NH7HWWXMYC2REOSRDY7TP26RMHA5CNFSM4HXSJRH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX3OPRQ%23issuecomment-502720454&data=02%7C01%7CMatthew.Neely%40microsoft.com%7C459590369e474de9dd7d08d6f334aa16%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636963804852091885&sdata=6nBOTko%2BRcpdslShqvb3StznIkO238yRKqbWcaPkqs4%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAL3NH7EAAO6NEWZ3RFBNJBTP26RMHANCNFSM4HXSJRHQ&data=02%7C01%7CMatthew.Neely%40microsoft.com%7C459590369e474de9dd7d08d6f334aa16%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636963804852101886&sdata=PPt5haKd9Y7%2BXD38y%2BPTpbOwemGK9%2BIxb2lcjaScyIc%3D&reserved=0.

Yes, if the command-line build is driven through an RTM VS instance, it follows the same rules as the VS UI.

That appears to be the winner:

In VS menu, “Tools --> Options”:
Settings in section “Environment --> Preview Features”, set “Use previews of the .NET Core SDK” to checked.

Thanks, @Rainer Sigwaldraines@microsoft.com!

-M

From: Rainer Sigwald notifications@github.com
Sent: Monday, June 17, 2019 8:33 AM
To: dotnet/arcade arcade@noreply.github.com
Cc: Matt Neely Matthew.Neely@microsoft.com; Author author@noreply.github.com
Subject: Re: [dotnet/arcade] Unable to locate the .NET Core SDK (#3035)

Yes, if the command-line build is driven through an RTM VS instance, it follows the same rules as the VS UI.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Farcade%2Fissues%2F3035%3Femail_source%3Dnotifications%26email_token%3DAL3NH7EB2GZU5SD4LFPDPALP26VCPA5CNFSM4HXSJRH2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX3RVLI%23issuecomment-502733485&data=02%7C01%7CMatthew.Neely%40microsoft.com%7Cd83ee5fff2f941ace9ad08d6f33911fc%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636963823774300112&sdata=dkqZXsT4U9JozzpYeuXhO11YvnG1ZoL3Pe5PcVbF4Bg%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAL3NH7AZIDYASTJK5CBLO7LP26VCPANCNFSM4HXSJRHQ&data=02%7C01%7CMatthew.Neely%40microsoft.com%7Cd83ee5fff2f941ace9ad08d6f33911fc%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636963823774310110&sdata=7ulOxuZSNMIaZ72RXyCuz%2BWgvTie5utRUAzrZN0Cl4Q%3D&reserved=0.

Looks like we're resolved here.

I had this issue on the current 16.3 Visual Studio update (.net core 3.0 release version)... I fixed it by adding C:\Program Files\dotnet to my PATH variable, looks like it gets messed up somehow

Was this page helpful?
0 / 5 - 0 ratings