Add --sdk-version to dotnet to choose which SDK to use
See original GitHub issueCurrently, the only way to use a specific version of the .NET core SDK (that isn’t the most recent version installed) is with a global.json file.
We’d like the dotnet
command to have a command line option that selects which SDK to use.
We have a build tool that automatically downloads and installs the version of the SDK the user wants to use. If they don’t specify a specific version, we download the latest LTS and install it into a local directory. If the user later installs (or has already installed) the latest Current version of the SDK globally, their next build will use that version instead of the LTS version. Chaos ensues.
The published workaround is to use a global.json file. Unfortunately, once they use a global.json file, they are then pinned to that version, instead of always getting the latest LTS version. 😦
Please add a --sdk-version
option to the dotnet command for choosing what version to use. That way, our build took can use it to guarantee a user is always on the version they want.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:10 (6 by maintainers)
Top GitHub Comments
If 2 people misread this, we should perhaps tweak. @spboyer and @PRIMETSS, do you think the following change would have helped?
Current docs:
globaljson –sdk-version <VERSION_NUMBER> - Specifies the version of the .NET Core SDK to use in the global.json file.
Suggestion:
globaljson –sdk-version <VERSION_NUMBER> - Specifies the version of the .NET Core SDK to use in the global.json file in the generated output.
For me the miss understanding wasn’t the wording or explanation as such, it was the simple fact I came across the doc when searching for something specific relating to what SDK version I was targeting on a machine that had multiple. I was investing if this was causing an issue. So as typical my eye caught “–sdk-version” and because it ‘sounds’ like a stand alone switch so I started to try and use it without refering to the doc. So the problem is I miss understood the option is a switch on the Template, not stand alone say like ‘–force’ or ‘new’. Its a silly over look, as I mentioned above, as the Doc is totally correct and once read carefully from the top to bottom it explains how to use it with the global.json Template. I think maybe because the global.json template is a bit of an ‘odd’ template as it just generates the global.json file and sticks the --sdk-version text in there. It might help if there was a description line under globaljson that just highlights/reminds people what it does. What would have also helped for me is if the example had its full use , eg "globaljson --sdk-version <VERSION_NUMBER>
I originally thought fully written examples everywhere might be a better way to go, but after a bit of thought I can see that’s a major re-write of the docs, and also would require options that had multiple 1st part options like console/angular/react… would mean that you would need to show full text examples for each possible combination… which of course is a totally a waste of time, and would make the doc size grow
console, angular, react, reactredux –no-restore - Doesn’t perform an implicit restore during project creation.
So again, its a silly one. But I think just a line under each template with a brief description of what they do (even though most are obvious) would help people to not assume like I did that --sdk-version somehow did some magic in the background.