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

If sdk version specified in global.json is not found, latest sdk is used silently #2771

Closed
nguerrera opened this issue May 9, 2017 · 8 comments
Assignees
Milestone

Comments

@nguerrera
Copy link
Contributor

Steps to reproduce

  • Use a global.json specifying an SDK that is not installed.
  • Check dotnet --version (or more generally, use any cli verb and see which sdk it uses)
D:\repro> dir /b "c:\Program Files\dotnet\sdk"
1.0.0
1.0.0-preview2-003121
1.0.0-preview2-003131
1.0.4
2.0.0-preview1-005957

D:\repro> type global.json
{
  "sdk": {
    "version": "1.2.0"
  }
}

D:\repro> dotnet --version
2.0.0-preview1-005957

Expected behavior

An error is reported indicating that the version specified in global.json is not present

Actual behavior

It just uses latest SDK instead (effectively ignoring global.json)

Scenarios

  • Typos in global.json can get ignored.
  • Teams can't impose a specific sdk version because on machines where that SDK is not installed, it will just use whatever is latest

Environment data

.NET Command Line Tools (2.0.0-preview1-005957)

Product Information:
 Version:            2.0.0-preview1-005957
 Commit SHA-1 hash:  056ac0e9cd

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.15063
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.0.0-preview1-005957\

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0-preview1-002111-00
  Build    : 1ff021936263d492539399688f46fd3827169983

@eerhardt @gkhanna79 @livarcocc @johnbeisner @dsplaisted

@gkhanna79
Copy link
Member

@livarcocc Please triage for milestone and assign to appropriate individual.

@nguerrera
Copy link
Contributor Author

This is higher priority than dotnet/core-setup#2336

@nguerrera nguerrera assigned johnbeisner and unassigned livarcocc May 10, 2017
@karelz
Copy link
Member

karelz commented May 13, 2017

This is blocking .NET Core 2.0 ZBB on 5/10.
If it is non-trivial I am fine moving it to Post-ZBB, given that it came quite late and close to the ZBB data.

@nguerrera @gkhanna79 any preferences?

@gkhanna79
Copy link
Member

gkhanna79 commented May 13, 2017 via email

@nguerrera
Copy link
Contributor Author

It is not trivial enough to be filed on May 9 @ 5 PM and fixed by May 10. ;) Track it however appropriate, but it needs to be fixed. @johnbeisner is working on it.

@karelz
Copy link
Member

karelz commented May 13, 2017

OK, seems non-trivial. Given it came in late, I'm marking it as Post-ZBB.

johnbeisner referenced this issue in johnbeisner/core-setup May 15, 2017
@johnbeisner
Copy link
Contributor

@johnbeisner
Copy link
Contributor

cherry-pick the changes to release/2.0.0

johnbeisner referenced this issue in johnbeisner/core-setup May 19, 2017
@msftgits msftgits transferred this issue from dotnet/core-setup Jan 30, 2020
@msftgits msftgits added this to the 2.0.0 milestone Jan 30, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants