Skip to content

C#: Download latest dotnet SDK when missing #15692

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

Merged
merged 7 commits into from
Feb 23, 2024

Conversation

tamasvajk
Copy link
Contributor

@tamasvajk tamasvajk commented Feb 22, 2024

This PR extends the dotnet SDK downloading in buildless mode. If there's no dotnet CLI on the machine, it downloads the latest one as if that version was specified in the global.json. This way buildless extraction doesn't depend on dotnet being installed beforehand onto the machine.

@github-actions github-actions bot added the C# label Feb 22, 2024
@tamasvajk tamasvajk marked this pull request as ready for review February 22, 2024 15:20
@tamasvajk tamasvajk requested a review from a team as a code owner February 22, 2024 15:20
@tamasvajk tamasvajk marked this pull request as draft February 22, 2024 15:39
@tamasvajk tamasvajk marked this pull request as ready for review February 22, 2024 15:59

if (ensureDotNetAvailable)
{
return DownloadDotNetVersion(builder, installDir, Constants.LatestDotNetSdkVersion, needExactVersion: false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we simply skip the --version argument to the install script? That should install the latest version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tried that, but I think it wouldn't work. You can pass latest to -Version, but you need to also specify the -Channel. Also, I think it's somewhat safer to control the exact fallback version, and then the version that we use seems to be a good candidate.

Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tamasvajk tamasvajk merged commit 72f7355 into github:main Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants