Skip to content

[msbuild] Show a better error for invalid SupportedOSPlatformVersion values. Fixes #23626 - #26488

Merged
rolfbjarne merged 6 commits into
mainfrom
dev/rolf/issue-23626-show-a-better-error-with-invalid-support-636dd4
Sep 3, 2026
Merged

[msbuild] Show a better error for invalid SupportedOSPlatformVersion values. Fixes #23626#26488
rolfbjarne merged 6 commits into
mainfrom
dev/rolf/issue-23626-show-a-better-error-with-invalid-support-636dd4

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Validate SupportedOSPlatformVersion and MinSupportedOSPlatformVersion before writing linker options.

This prevents embedded whitespace such as a newline from producing a confusing linker "No equals sign" error.

Fixes #23626

🤖 Pull request created by Copilot

rolfbjarne and others added 2 commits August 28, 2026 00:26
…formVersion values containing whitespace

A value with an embedded newline (e.g. from an XML formatting mistake)
would previously pass Version.TryParse successfully, but later break
the line-based custom-linker-options.txt file, producing a confusing
'No equals sign' error. Validate up front and report a clear error
instead.

Fixes #23626

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 655532d6-e35b-427a-bf9e-3ada6eb79ec6
Copilot AI lite review requested due to automatic review settings August 28, 2026 09:07

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

This PR improves the MSBuild UX for invalid SupportedOSPlatformVersion / MinSupportedOSPlatformVersion values by failing early with a targeted diagnostic when those properties contain whitespace (notably newlines), preventing downstream linker-option parsing errors like “No equals sign”.

Changes:

  • Validate SupportedOSPlatformVersion and MinSupportedOSPlatformVersion for embedded whitespace before using them during app manifest compilation.
  • Add a new localized error string (E7187) for the whitespace validation failure.
  • Add a regression test covering a newline-prefixed SupportedOSPlatformVersion value.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/CompileAppManifestTaskTests.cs Adds a regression test asserting the new error message for whitespace in SupportedOSPlatformVersion.
msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs Adds early validation to catch whitespace-containing version values and emit a clear error instead of producing broken downstream option files.
msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx Introduces the new E7187 error string used by the task.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 2 commits September 1, 2026 13:15
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@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

✅ 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: a83271dc2ac5841a3f22b49cd823fb5c6f46e447 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #a83271d] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 264 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ 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. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 7 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 31 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 25 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 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. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: a83271dc2ac5841a3f22b49cd823fb5c6f46e447 [PR build]

@rolfbjarne rolfbjarne added the ready-to-review This PR is ready to review/merge. label Sep 2, 2026
@rolfbjarne
rolfbjarne enabled auto-merge (squash) September 2, 2026 15:54
@rolfbjarne
rolfbjarne merged commit 59abedf into main Sep 3, 2026
54 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/issue-23626-show-a-better-error-with-invalid-support-636dd4 branch September 3, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show a better error with invalid SupportedOSPlatformVersion values

5 participants