Skip to content

Conversation

@ellahathaway
Copy link
Member

@ellahathaway ellahathaway commented Dec 1, 2025

Fixes dotnet/source-build#5428

This PR specifies the sdk version (patch roll forward enabled) in the global.json, ensuring the build uses the correct SDK version.

Previously, builds could pick up a newer .NET SDK if it was installed, leading to version mismatches and MSBuild errors. Pinning the SDK version in global.json resolves this.

Test pipeline run

@ellahathaway ellahathaway requested a review from a team as a code owner December 1, 2025 20:12
global.json Outdated
".dotnet",
"$host$"
],
"errorMessage": "The required .NET SDK wasn't found."
Copy link
Member

Choose a reason for hiding this comment

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

Curious why this is needed/beneficial over the default?

Copy link
Member Author

@ellahathaway ellahathaway Dec 2, 2025

Choose a reason for hiding this comment

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

This ensures that the builds are more consistent and portable across different machines. It prevents errors like what’s described in dotnet/source-build#5428 from occurring.

Copy link
Member

Choose a reason for hiding this comment

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

I am specifically referring to the errorMessage. I ask because when I have seen this in the past, it typically contains something custom like "Please run ./eng/common/dotnet.cmd/sh to install it.". Doesn't the default message already convey the required SDK was not found?

Copy link
Member Author

Choose a reason for hiding this comment

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

Gotcha. Those dotnet scripts don't exist in this branch (only 10.0+), so I think the default message is appropriate. Addressed in c95b757

Removed error message from global.json.
@ellahathaway ellahathaway merged commit a66a5c1 into dotnet:release/9.0 Dec 2, 2025
2 checks passed
@ellahathaway ellahathaway deleted the sdk-fix branch December 2, 2025 19:34
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

Successfully merging this pull request may close these issues.

3 participants