Skip to content

[dotnet] Fix the .NET 10 MSI minor-version computation for Xcode 27 and later - #25688

Merged
dalexsoto merged 1 commit into
mainfrom
dev/alex/vsworkloadgen
Jun 15, 2026
Merged

[dotnet] Fix the .NET 10 MSI minor-version computation for Xcode 27 and later#25688
dalexsoto merged 1 commit into
mainfrom
dev/alex/vsworkloadgen

Conversation

@dalexsoto

Copy link
Copy Markdown
Member

The .NET 10 custom MSI version scheme in generate-vs-workload bumped the minor version using:

int.Parse (new Version (26 - xcodeMajor, xcodeMinor).ToString ().Replace (".", ""))

For Xcode 27 and later, (26 - xcodeMajor) is negative, and the System.Version constructor rejects negative components, so this threw and broke VS workload generation.

Compute the bump arithmetically instead:

minorVersionBump = (xcodeMajor - 26) * 10 + xcodeMinor

This is equivalent to the old expression for the Xcode 26.x series (single-digit minor) and keeps the MSI minor monotonically increasing with the Xcode version while staying above the 255.220.39248 baseline and below the 255 minor ceiling across .NET 10's supported Xcode range. A detailed explanation of the scheme is added as a comment.

Standalone backport of the generate-vs-workload.cs change from the Xcode 27 update (dotnet/macios #25665, commit 0dc3ce9), as suggested in code review; it is independent of the Xcode 27 bump itself.

…nd later

The .NET 10 custom MSI version scheme in generate-vs-workload bumped the minor
version using:

    int.Parse (new Version (26 - xcodeMajor, xcodeMinor).ToString ().Replace (".", ""))

For Xcode 27 and later, (26 - xcodeMajor) is negative, and the System.Version
constructor rejects negative components, so this threw and broke VS workload
generation.

Compute the bump arithmetically instead:

    minorVersionBump = (xcodeMajor - 26) * 10 + xcodeMinor

This is equivalent to the old expression for the Xcode 26.x series (single-digit
minor) and keeps the MSI minor monotonically increasing with the Xcode version
while staying above the 255.220.39248 baseline and below the 255 minor ceiling
across .NET 10's supported Xcode range. A detailed explanation of the scheme is
added as a comment.

Standalone backport of the generate-vs-workload.cs change from the Xcode 27
update (dotnet/macios #25665, commit 0dc3ce9), as suggested in code review;
it is independent of the Xcode 27 bump itself.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dalexsoto
dalexsoto requested review from Copilot and rolfbjarne June 15, 2026 13:48
@dalexsoto

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes VS workload generation for .NET 10 when building against Xcode 27+ by correcting the MSI minor-version bump computation (the previous implementation could throw due to negative System.Version components).

Changes:

  • Replace the previous System.Version-based bump computation with an arithmetic formula that works for Xcode 27 and later.
  • Add detailed in-code documentation explaining the MSI versioning scheme and constraints.

// minor = minimumVersion.Minor + (26 - Major Xcode version) * 10 + (Minor Xcode version)
var minorVersionBump = int.Parse (new Version (26 - Version.Parse (xcodeVersion).Major, Version.Parse (xcodeVersion).Minor).ToString ().Replace (".", ""));
var minorVersionBump = (Version.Parse (xcodeVersion).Major - 26) * 10 + Version.Parse (xcodeVersion).Minor;
// just use the commit distance for the build version, our minor version will be higher than the minimum version, so we can use any build version.
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #4166391] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 41663911baefe315fef2326ebf8f78434600d498 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #4166391] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 41663911baefe315fef2326ebf8f78434600d498 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 41663911baefe315fef2326ebf8f78434600d498 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #4166391] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 41663911baefe315fef2326ebf8f78434600d498 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #4166391] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 1 tests failed, 192 tests passed.

Failures

❌ introspection tests [attempt 3]

1 tests failed, 5 tests passed.

Failed tests

  • introspection/macOS/Debug: Failed (Test run failed.
    Tests run: 34 Passed: 33 Inconclusive: 0 Failed: 1 Ignored: 0)

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 11 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 23 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 23 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 20 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 41663911baefe315fef2326ebf8f78434600d498 [PR build]

@dalexsoto

Copy link
Copy Markdown
Member Author

Unrelated test failure
image

@dalexsoto
dalexsoto merged commit b8d53d7 into main Jun 15, 2026
54 of 56 checks passed
@dalexsoto
dalexsoto deleted the dev/alex/vsworkloadgen branch June 15, 2026 21:43
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.

4 participants