command-line-api icon indicating copy to clipboard operation
command-line-api copied to clipboard

The SDK 'Microsoft.DotNet.Arcade.Sdk' specified could not be found.

Open Balkoth opened this issue 1 year ago • 13 comments

Are there specific prerequisites needed to get these projects to load in Visual Studio? This does not mention anything special.

error : The SDK 'Microsoft.DotNet.Arcade.Sdk' specified could not be found. C:\Work\VisualStudioGitHub\command-line-api\Directory.Build.props

There are lots of questions around the web in regard to errors with 'Microsoft.DotNet.Arcade.Sdk' but no actual solution. So what am i missing?

Balkoth avatar May 15 '24 07:05 Balkoth

Hi, Microsoft.Dotnet.Arcade.Sdk documentation is located at GitHub.

Arcade is intended to provide well-understood and consistent mechanisms for consuming, updating, and sharing infrastructure across the .NET Core team

https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.Sdk/overview/9.0.0-beta.24260.2

Please add additional nuget package sources in Nuget Package Manager.

https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json

Bertk avatar May 15 '24 08:05 Bertk

This is what it looks like after double clicking System.CommandLine.sln from explorer, so it is already there: image

Balkoth avatar May 15 '24 08:05 Balkoth

I created a fork and was able to build the solution with Visual Studio 2022 without errors.

image

I manually executed the build for the EndToEndTestApp dotnet build dotnet-suggest.Tests.csproj

image

Please check the .NET runtimes on your desktop. Maybe one is missing e.g. dotnet 5.0.17

{
  "tools": {
    "dotnet": "8.0.101",
    "runtimes": {
      "dotnet": [
        "5.0.17",
        "6.0.7",
        "7.0.9"
      ]
    }
  },
  "msbuild-sdks": {
    "Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24170.6"
  }
}

Bertk avatar May 15 '24 08:05 Bertk

No, this does not matter. What matters on my dev machine is when i start Visual Studio with an admin account. Then it suddenly can open those projects and does not show this error.

I am still clueless what is causing this problem.

Balkoth avatar May 15 '24 12:05 Balkoth

I always use local admin permission for development environment. Microsoft arcade tooling will install missing SDK.

C:\GitHub\command-line-api>build
GET https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1
  Attempting to install 'sdk v8.0.101' from public location.
...

Admin privileges are required for some dotnet commands. https://learn.microsoft.com/en-us/dotnet/core/tools/elevated-access?tabs=windows

Bertk avatar May 15 '24 13:05 Bertk

I am using the official contribution documentation, there is no such info to run Visual Studio as administrator.

And btw you are mixing running command line commands with Visual Studio. The original issue is that the projects on my machine do not load because of the error outlined in the op.

Balkoth avatar May 15 '24 13:05 Balkoth

I believe there's a package missing from the preview feed. You can potentially bypass this by using a release version of the SDK, by setting an environment variable DisableArcade to 1.

jonsequitur avatar May 15 '24 14:05 jonsequitur

Two things need to be done in order to successfully load and build the projects:

  • Set environment variable DisableArcade to 1
  • Delete NuGet.config from the root directory

Balkoth avatar May 15 '24 15:05 Balkoth

And btw you are mixing running command line commands with Visual Studio. The original issue is that the projects on my machine do not load because of the error outlined in the op.

The VS behavior is different from the shell scripts and the main usage for arcade is the CI based using shell scripts. The VS behavior is narrowed.

Bertk avatar May 15 '24 17:05 Bertk

I believe we can agree that the goal should be:

  • Read and follow the steps in CONTRIBUTING.md
  • Be able to open and build the solution in Visual Studio

If it's not that way everyone's time trying to investigate this project is wasted with first trying to figure out how to get started...

Balkoth avatar May 16 '24 05:05 Balkoth

We are interested in finding and solving any issues in the CONTRIBUTING.md file that there are and really want to. I attempted to reproduce the issue on a fresh machine, but I was unable to do so. This may point to a machine specific issue, that we want to identify and note in the CONTRIBUTING.md file as needed, so any more information you may have would be helpful..

BenjaminMichaelis avatar May 21 '24 17:05 BenjaminMichaelis

Tell me what you need to know and i will try to provide this information.

The NuGet.config you provide does not play well with the NuGet-Feature "Package Source Mapping". Adding the following to it lets me at least load the projects:

<packageSourceMapping>
  <packageSource key="dotnet-public">
    <package pattern="*" />
  </packageSource>
  <packageSource key="dotnet5">
    <package pattern="*" />
  </packageSource>
  <packageSource key="dotnet5-transport">
    <package pattern="*" />
  </packageSource>
  <packageSource key="dotnet-eng">
    <package pattern="*" />
  </packageSource>
  <packageSource key="dotnet-tools">
    <package pattern="*" />
  </packageSource>
  <packageSource key="dotnet-libraries">
    <package pattern="*" />
  </packageSource>
  <packageSource key="dotnet8">
    <package pattern="*" />
  </packageSource>
</packageSourceMapping>

Balkoth avatar May 22 '24 05:05 Balkoth

@Balkoth , for me also worked this:

  <packageSourceMapping>
    <clear/>
  </packageSourceMapping>

voroninp avatar Oct 05 '24 20:10 voroninp

Seems no one is interested to fix this for non Microsoft employees which may have this setup by default to work for them. I posted my workaround above. Closing.

Balkoth avatar Nov 20 '24 14:11 Balkoth

For those who would like the resolve this issue without any changes to the repo. Removing the package source mappings as shown in the image below also works

Image

xortock avatar Jan 11 '25 20:01 xortock

Be carefull, you mess up your environment when you clear this in Visual Studio.

Balkoth avatar Jan 11 '25 20:01 Balkoth