Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet does not find latest patch version of SDK specified in global.json #10286

Closed
VanCoding opened this issue May 24, 2019 · 1 comment
Closed
Milestone

Comments

@VanCoding
Copy link

Steps to reproduce

  • Install latest SDK version (2.2.204 in my casse)
  • Install SDK version 2.1.300
  • in global.json set sdk.version to 2.1.0
  • try to dotnet restore the project.

Expected behavior

All dependencies get installed.

Actual behavior

I get an error message, stating "A compatible SDK version for global.json version: [2.1.0] from [...] was not found.

Environment data

dotnet --info output:

A compatible SDK version for global.json version: [2.1.0] from [...] was not found

Host (useful for support):
  Version: 2.2.5
  Commit:  0a3c9209c0

.NET Core SDKs installed:
  2.1.300 [C:\Program Files\dotnet\sdk]
  2.1.700 [C:\Program Files\dotnet\sdk]
  2.2.204 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

notes

According to https://docs.microsoft.com/en-us/dotnet/core/tools/global-json#matching-rules, when dotnet does not find the exact sdk version specified in global.json, it should use the latest patch version instead (which would be 2.1.700 in my case, or 2.1.300 when just following the mentioned steps above). But it does not do that, so I think either the docs are wrong, or there is a bug.

@livarcocc
Copy link
Contributor

Patchs for the SDK are on the hundreds version, for instance, 2.1.300 would match 2.1.300, 2.1.301, 2.1.303, etc.

We are considering a way to specify a major.minor version on the global.json but that does not exist yet. As such, right now, this issue is by design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants