Skip to content

Read the .NET SDK Line From global.json in the Hub's setup-dotnet Steps #4107

Closed

Description

@ptr727

Problem

The hub's setup-dotnet steps hard-code dotnet-version: 10.x:

  • .github/workflows/validate-task.yml (two steps)
  • .github/workflows/get-version-task.yml
  • .github/workflows/run-codegen-pull-request-task.yml
  • .github/actions/dotnet-publish-default/action.yml
  • .github/actions/nuget-build-default/action.yml
  • catalog/snippets/workflows/publish-release.yml

After #4103 every .NET repo carries a global.json sdk block naming its SDK line. The two now state the same fact twice. A repo moving to a new TFM cannot move alone, because the hub's steps still install the old line.

Proposed Fix

Read global-json-file: global.json in place of dotnet-version, making global.json the single source of the SDK line. This needs every .NET repo to carry the file first, so it follows the #4103 resync rollout rather than preceding it. A caller with no global.json would otherwise get no SDK.

This was the optional follow-up named in #4103.

Activity

  1. added
    enhancement
    on Nov 12, 2026
  2. ptr727 commented on Nov 12, 2026

    @ptr727
    OwnerAuthor

    A related ordering point from the #4109 review: during a TFM major move the hub's steps must install both lines (for example a multi-line dotnet-version) until every .NET repo has moved its global.json floor. Installing only the new line leaves every repo still on the old floor with no compatible SDK. Reading global-json-file per repo, as proposed here, removes that coupling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions