Skip to content

Pin the SDK per line with a global.json (10.0.x on main, 11.0.x on net11) #207

Closed

Description

@CaffeinatedCoder

Problem

The repository has no global.json. CI pins dotnet-version: 10.0.x in dotnet.yml and release.yml, but a local build takes whatever SDK is first on the machine. An external assessment on 2026-10-18 built the repo with an installed .NET 11 RC SDK while CI compiled with .NET 10, so the compiler that checked the code locally was not the one that ships it. (On the maintainer's machine dotnet --version is 10.0.402, so the mismatch is per machine, which is exactly why it should be pinned in the repo.)

With two lines (10.x LTS on main/release/10.x, 11.x on net11) the pin is also where the per-line SDK policy lives, and it is what #152 (CI matrix for two lines) should read instead of a hard-coded version in each workflow.

Proposed change

  • global.json on main: { "sdk": { "version": "10.0.100", "rollForward": "latestFeature" } } so any 10.0.x SDK satisfies it and an 11.x one is refused.
  • The same file on net11 with the 11 version.
  • Workflows read the pin (setup-dotnet honours global.json when global-json-file is set) so there is one place to bump.
  • A line in CONTRIBUTING.md under branches and releases saying each line pins its SDK there.

Verification

With an 11.x SDK first on PATH, dotnet --version inside the repo must print a 10.0.x version and dotnet build must use it; with no 10.x SDK installed it must fail with the SDK-not-found error rather than roll forward.

Activity

  1. added this to the 10.0.0 milestone on Oct 18, 2026
  2. added
    chore
    area/release
    on Oct 18, 2026
  3. CaffeinatedCoder commented on Oct 18, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Landed as #214 with one deviation from the proposal: the release workflow's publish job keeps dotnet-version: 10.0.x (with a comment), because it has no checkout and therefore no global.json; it only pushes the verified packages. Every job that builds reads global-json-file. The net11 pin is a separate change on that branch.

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

    area/releasechore

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions