Skip to content

Update .NET SDK to 9.0.310 and use global.json for CI version control#779

Merged
Arlodotexe merged 2 commits intomainfrom
dependency/dotnet/global-json-9.0.310
Feb 3, 2026
Merged

Update .NET SDK to 9.0.310 and use global.json for CI version control#779
Arlodotexe merged 2 commits intomainfrom
dependency/dotnet/global-json-9.0.310

Conversation

@Arlodotexe
Copy link
Member

Problem

The current CI setup has version specified in two places:

  1. global.json with exact version (9.0.308) and rollForward: disable
  2. DOTNET_VERSION env var in workflow with floating version (9.0.x)

This led to a previous breakage when GitHub Actions runners installed 9.0.309 while global.json expected 9.0.308 (fixed in #826 by disabling rollForward).

Solution

This PR implements single source of truth for .NET SDK version:

  • Version update: 9.0.308 → 9.0.310
  • Workflow pattern: Use global-json-file: global.json input for actions/setup-dotnet@v4
  • Step reordering: Checkout repository before setup-dotnet (required for global.json access)

Changes

global.json:

  • Updated SDK version to 9.0.310

build.yml:

  • Reordered steps: actions/checkout now precedes actions/setup-dotnet
  • Changed setup-dotnet input from dotnet-version: 9.0.x to global-json-file: global.json
  • Retained DOTNET_VERSION env var for artifact-only jobs (sign, nuget) that cannot access global.json

Benefits

  • ✅ Single source of truth for SDK version
  • ✅ Prevents future version drift
  • ✅ Simplifies version updates (edit global.json only)
  • ✅ Follows setup-dotnet recommended pattern

Related

  • #826 - Disabled rollForward to prevent SDK mismatch

@Arlodotexe Arlodotexe force-pushed the dependency/dotnet/global-json-9.0.310 branch 2 times, most recently from f6cd4cf to b2e417c Compare February 2, 2026 23:25
- Update SDK version from 9.0.308 to 9.0.310 in global.json
- Reorder workflow steps: checkout before setup-dotnet
- Use global-json-file input for jobs with checkout
- Maintain DOTNET_VERSION env var for artifact-only jobs (no checkout)

This eliminates version duplication and prevents future drift between
global.json and workflow definitions. Related to PR #826 which disabled
rollForward to prevent SDK version mismatches.
@Arlodotexe Arlodotexe force-pushed the dependency/dotnet/global-json-9.0.310 branch from b2e417c to f2c2b3d Compare February 2, 2026 23:25

env:
DOTNET_VERSION: ${{ '9.0.x' }}
DOTNET_VERSION: '9.0.310' # Only used by jobs that cannot access global.json (no checkout/artifact-only jobs)
Copy link
Member

Choose a reason for hiding this comment

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

In these cases it's only for nuget push, eh? Is there an alternate download/install way for the nuget tool vs. dotnet we could use to avoid tracking this version here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Our options are:

  1. What we did here
  2. Hardcoding inline
  3. Cloning the repo so we have access to global.json

Copy link
Member Author

Choose a reason for hiding this comment

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

Noting also duplicate with CommunityToolkit/Windows#827

@Arlodotexe Arlodotexe enabled auto-merge February 2, 2026 23:50
@Arlodotexe Arlodotexe merged commit 5edacbe into main Feb 3, 2026
23 of 24 checks passed
@Arlodotexe Arlodotexe deleted the dependency/dotnet/global-json-9.0.310 branch February 3, 2026 01:12
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.

2 participants