Skip to content

[release/11.0.1xx] [dotnet] Preserve parameter names in remote Windows iOS builds. Fixes #26680 - #26852

Merged
rolfbjarne merged 5 commits into
release/11.0.1xxfrom
dev/rolf/backport-pr-26693-release/11.0.1xx-2026-10-13
Oct 14, 2026
Merged

rolfbjarne merged 5 commits into
release/11.0.1xxfrom
dev/rolf/backport-pr-26693-release/11.0.1xx-2026-10-13

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Summary

Fix Debug iOS builds driven from Windows through Pair to Mac stripping parameter names from trimmed assemblies. The Windows _RunILLink override now forwards KeepMetadata="@(_TrimmerKeepMetadata)" and PreserveSymbolPaths="$(_TrimmerPreserveSymbolPaths)" to the remote ILLink task, matching the .NET SDK target used by Mac-driven builds. This preserves parameter metadata needed by reflection-based consumers without changing the SDK's trimming policy.

Add a remote Windows regression test that builds an iOS app referencing a trimmable library, then inspects the linked library copied back from the Mac and checks its constructor and method parameter names.

Fixes #26680

🤖 Pull request created by Copilot


Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com
Co-authored-by: Rolf Bjarne Kvinge rokvin@microsoft.com

Backport of #26693.

rolfbjarne and others added 5 commits October 13, 2026 18:09
Build a Debug iOS app from Windows with a trimmable library and inspect the linked assembly copied back from the Mac. Assert that constructor and method parameter names remain intact, matching the .NET SDK's debugger-friendly trimming behavior. Leave the Windows ILLink target unchanged so CI can demonstrate the regression before the fix.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
WindowsTest already imports System.Reflection.Metadata, which also defines AssemblyDefinition. Qualify the Cecil type used to inspect the linked fixture assembly so the regression test compiles without changing either existing namespace import.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Handle a missing linked model explicitly so the test reports its assertion failure before inspecting methods. This also keeps the remote regression test aligned with the repository's nullable code conventions.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The regression inspects linked parameter names directly, so the app only needs to root its constructor and method. Avoid reflection-based JSON serialization warnings that could fail the remote build before the intended metadata assertion runs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Forward the SDK's KeepMetadata items and PreserveSymbolPaths setting to the remote ILLink task. Debug builds now retain parameter names in trimmed assemblies when driven from Windows, matching builds driven directly from the Mac; deterministic source path handling also stays consistent with the SDK target. The previously committed Pair-to-Mac regression test observed the missing constructor names on Windows CI before this fix.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 16:10
@rolfbjarne rolfbjarne added backported ready-to-review This PR is ready to review/merge. labels Oct 13, 2026

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.

🟢 Approval recommended

The targeted backport correctly forwards the missing settings and includes focused regression coverage.

0 open findings

What changed in this PR

Preserves parameter metadata in remote Windows iOS builds by aligning the remote ILLink invocation with the .NET SDK.

Changes:

  • Forwards metadata and symbol-path trimming options.
  • Adds a remote Windows regression test and trimmable fixture.
File Description
msbuild/​Xamarin.iOS.Tasks.Windows/​Xamarin.iOS.Common.After.targets Forwards omitted ILLink settings.
tests/​dotnet/​UnitTests/​WindowsTest.cs Verifies linked parameter names.
tests/​dotnet/​TrimmerMetadata/​Library/​TrimmerMetadataLibrary.csproj Defines the trimmable library.
tests/​dotnet/​TrimmerMetadata/​Library/​MetadataModel.cs Provides parameter metadata to inspect.
tests/​dotnet/​TrimmerMetadata/​iOS/​TrimmerMetadata.csproj Defines the regression application.
tests/​dotnet/​TrimmerMetadata/​iOS/​Program.cs Roots the tested members.

🧠 Review effort: Balanced

@rolfbjarne
rolfbjarne enabled auto-merge (squash) October 13, 2026 16:34
@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 (Breaking changes)

NET (empty diffs)

ℹ️ Generator diff

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

Pipeline on Agent
Hash: 62827cf0051aa1b2e095f78d0e659591545dd4f8 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [CI Build #62827cf] Prepare .NET Release succeeded ✅

📦 Published NuGet packages (32 packages)

iOS

  • Microsoft.iOS.Ref.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.iOS.Runtime.ios-arm64.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.iOS.Runtime.ios.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.iOS.Runtime.iossimulator-arm64.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.iOS.Runtime.iossimulator-x64.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.iOS.Sdk.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.iOS.Templates.27.0.12226.nupkg
  • Microsoft.iOS.Windows.Sdk.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.NET.Sdk.iOS.Manifest-11.0.100.27.0.12226.nupkg

MacCatalyst

  • Microsoft.MacCatalyst.Ref.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.MacCatalyst.Sdk.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.MacCatalyst.Templates.27.0.12226.nupkg
  • Microsoft.NET.Sdk.MacCatalyst.Manifest-11.0.100.27.0.12226.nupkg

macOS

  • Microsoft.macOS.Ref.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.macOS.Runtime.osx-arm64.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.macOS.Runtime.osx-x64.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.macOS.Runtime.osx.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.macOS.Sdk.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.macOS.Templates.27.0.12226.nupkg
  • Microsoft.NET.Sdk.macOS.Manifest-11.0.100.27.0.12226.nupkg

tvOS

  • Microsoft.NET.Sdk.tvOS.Manifest-11.0.100.27.0.12226.nupkg
  • Microsoft.tvOS.Ref.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.tvOS.Runtime.tvos-arm64.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.tvOS.Runtime.tvos.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-arm64.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-x64.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.tvOS.Sdk.net11.0_27.0.27.0.12226.nupkg
  • Microsoft.tvOS.Templates.27.0.12226.nupkg

Other

  • Sharpie.Bind.Tool.27.0.0.1226.nupkg

Pipeline on Agent
Hash: 62827cf0051aa1b2e095f78d0e659591545dd4f8 [PR build]

@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

🚀 [CI Build #84f3445] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 269 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. [attempt 5] 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
✅ Tests on macOS Golden Gate (27): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: 84f3445295f5f5d011e0c5619276047cc168273e [PR build]

@rolfbjarne
rolfbjarne merged commit 83f2323 into release/11.0.1xx Oct 14, 2026
56 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/backport-pr-26693-release/11.0.1xx-2026-10-13 branch October 14, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants