Skip to content

[net11.0] Merge main into net11.0. - #26328

Open
rolfbjarne wants to merge 9 commits into
net11.0from
dev/rolf/bump-main-in-net11.0-2026-07-28
Open

[net11.0] Merge main into net11.0.#26328
rolfbjarne wants to merge 9 commits into
net11.0from
dev/rolf/bump-main-in-net11.0-2026-07-28

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

No description provided.

dalexsoto and others added 8 commits July 28, 2026 08:06
## Summary

- prevent late asynchronous `log stream` callbacks from writing after
the diagnostic `StreamWriter` is closed
- bound SIGINT, force-termination, and output-drain waits so cleanup
cannot hang test jobs
- report drain, flush, and disposal failures without failing an
otherwise successful test run

## Root cause

The macOS 27 test leg twice completed all suites successfully, then
failed while shutting down diagnostic logging:

```
5 suites passed, 0 suites failed.
Unhandled exception. System.ObjectDisposedException: Cannot write to a closed TextWriter.
```

`WaitForExit (10_000)` waited for the process but not the asynchronous
output handlers, so buffered `DataReceived` callbacks could arrive after
writer disposal.

This was split from #26280 at reviewer request so the infrastructure fix
can flow through `main` independently.

## Validation

- built
`scripts/run-packaged-macos-tests/run-packaged-macos-tests.csproj` with
0 warnings and 0 errors
- independent GPT-5.6 Sol and Claude Opus 4.8 max-reasoning concurrency
reviews

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ebf4376b-3b4c-4492-acef-18607e6f4ea1
Copilot-Session: f09fc2f9-a071-47c6-84ff-02aa45e9e0c0
Remove `Foundation.RequiredMemberAttribute` and `Foundation.OptionalMemberAttribute` instances unconditionally using the platform assembly's embedded ILLink descriptor.

Add linked-output metadata coverage that verifies both Foundation attributes are removed while `System.Runtime.CompilerServices.RequiredMemberAttribute` remains unaffected.

🤖 Pull request created by Copilot
Addresses a review comment from #26292.

## Problem

In `tests/common/TestRuntime.LinkAll.cs`, the `IsLinkAll` property resolved the `+LinkerSentinel` type using a compile-time-constant type name:

```csharp
link_all = typeof (TestRuntime).Assembly.GetType (typeof (TestRuntime).FullName + "+LinkerSentinel") is null;
```

The trimmer's dataflow analysis (dotnet/runtime#127319) can resolve that constant string and preserve the `LinkerSentinel` type, which would make `IsLinkAll` incorrectly report `false` even in link-all builds.

## Fix

Introduce a `WorkAroundLinkerHeuristics` property that returns `""` at runtime (but the trimmer can't constant-fold) and append it to the type-name string, so the trimmer can no longer statically resolve `+LinkerSentinel`. This matches the pattern already used in `tests/linker/*` (e.g. `CommonLinkAllTest.cs`, `PreserveTest.cs`).

🤖 Pull request created by Copilot

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ed (#26312)

The test infrastructure (tests/common/shared-dotnet.csproj) unconditionally set the following ILC properties for every NativeAOT publish:

    IlcGenerateCompleteTypeMetadata=true   (--completetypemetadata)
    IlcTrimMetadata=false                   (--reflectiondata:all)

These were added as a workaround for NUnit 4.x, whose EquatablesComparer calls Type.GetInterfaceMap(), which requires complete type metadata (see nunit/nunit#3970).

However, they were applied to *all* NativeAOT test apps, including apps that don't reference NUnit at all (e.g. SizeTestApp). Together these flags make every reflectable type keep complete metadata and every compiled method reflectable, which defeats trimming and dramatically inflates app size - for the trimmable-static registrar in particular they were the dominant driver of the complete-metadata cascade through the registered NSObject binding surface.

This change gates both flags on `'$(ExcludeNUnitLiteReference)' != 'true'`, the exact same condition that already governs whether NUnitLite is referenced and whether nunit.framework.targets is imported. Apps that reference NUnit keep the workaround; apps that don't no longer pay the size cost.

The expected app-size files are regenerated accordingly - NativeAOT sizes (and especially the trimmable-static variants) drop substantially.

🤖 Pull request created by Copilot

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Filter, NSSecureCoding, MDLVertexFormatExtensions, UIBarItem, CNInstantMessageAddress, CNSocialProfile, NSPrintInfo (#26314)

Improve XML documentation for 10 types:

- UISegmentedControl
- VNUtils
- CGVector
- CIFilter
- NSSecureCoding
- MDLVertexFormatExtensions
- UIBarItem
- CNInstantMessageAddressOption / CNInstantMessageAddress
- CNSocialProfileOption / CNSocialProfile
- NSPrintInfo

Changes include adding missing summaries, fixing tag ordering (summary before param), removing empty elements, and normalizing indentation.

🤖 Pull request created by Copilot

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…perties (#26310)

Expand the documentation for the two on-demand-resources (ODR) build properties. The difference between them caused customer confusion in issue #26218, where a user thought on-demand resources were disabled by default (they aren't on iOS) and that the "Embed on-demand resources in the app bundle" option was what turned the feature on (it doesn't).

* `EnableOnDemandResources`: explain that this is what turns ODR on, and show how to tag a resource with `ResourceTags` metadata — using `Update` rather than `Include` for resources that are already part of the project's default resources, and mentioning the `MauiAsset` equivalent for .NET MAUI projects.
* `EmbedOnDemandResources`: clarify that it does NOT enable ODR, and only controls where asset packs are placed when packaging an IPA for distribution.

The two entries now cross-reference each other.

Ref #26218 (which revealed the confusing/lacking documentation).

🤖 Pull request created by Copilot
@rolfbjarne
rolfbjarne requested a review from dalexsoto as a code owner July 28, 2026 13:30
Copilot AI review requested due to automatic review settings July 28, 2026 13:30

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 merges main into the net11.0 branch, bringing over recent test coverage, linker behavior adjustments, documentation improvements, and assorted API XML-doc cleanups relevant to trimming/NativeAOT and packaging behavior.

Changes:

  • Added a new dotnet unit test + a small test app to validate that Foundation.RequiredMemberAttribute / Foundation.OptionalMemberAttribute attribute instances are removed by trimming, while the BCL RequiredMemberAttribute remains.
  • Reduced NativeAOT test app sizes by only enabling “complete type metadata” when NUnit is actually referenced, and updated size-baseline expected outputs accordingly.
  • Improved reliability/robustness of packaged macOS test execution logging, and expanded build-properties documentation for on-demand resources.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/dotnet/UnitTests/PublishTrimmedTest.cs Adds a trimming regression test that inspects output assemblies with Cecil to ensure specific Foundation attribute instances are removed.
tests/dotnet/UnitTests/expected/TVOS-NativeAOT-TrimmableStatic-size.txt Updates expected NativeAOT size baselines after metadata/linking changes.
tests/dotnet/UnitTests/expected/TVOS-NativeAOT-size.txt Updates expected NativeAOT size baselines after metadata/linking changes.
tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-TrimmableStatic-size.txt Updates expected NativeAOT size baselines after metadata/linking changes.
tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-size.txt Updates expected NativeAOT size baselines after metadata/linking changes.
tests/dotnet/UnitTests/expected/MacCatalyst-NativeAOT-TrimmableStatic-size.txt Updates expected NativeAOT size baselines after metadata/linking changes.
tests/dotnet/UnitTests/expected/MacCatalyst-NativeAOT-size.txt Updates expected NativeAOT size baselines after metadata/linking changes.
tests/dotnet/UnitTests/expected/iOS-NativeAOT-TrimmableStatic-size.txt Updates expected NativeAOT size baselines after metadata/linking changes.
tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt Updates expected NativeAOT size baselines after metadata/linking changes.
tests/dotnet/LinkerAttributesTestApp/LinkerAttributesTestApp.csproj Introduces a minimal iOS test app used by the new trimming regression test.
tests/dotnet/LinkerAttributesTestApp/AppDelegate.cs Implements the test app code that exercises Required/Optional member attributes and required properties.
tests/common/TestRuntime.LinkAll.cs Adjusts link-all detection to avoid trimmer constant-folding issues affecting GetType heuristics.
tests/common/shared-dotnet.csproj Makes NativeAOT “complete metadata” settings conditional on NUnit presence to avoid unnecessary size bloat.
src/ILLink.LinkAttributes.xml.in Adds trimming directives to remove instances of Foundation.RequiredMemberAttribute / Foundation.OptionalMemberAttribute.
scripts/run-packaged-macos-tests/run-packaged-macos-tests.cs Prevents late async log callbacks from writing to a disposed writer; improves shutdown/drain logic.
docs/building-apps/build-properties.md Expands documentation for on-demand resources packaging behavior and related properties.
src/Vision/VNUtils.cs Cleans up XML docs (removes placeholder remarks/values; improves param docs).
src/UIKit/UISegmentedControl.cs Cleans up constructor XML docs (removes placeholder remarks; improves param docs).
src/UIKit/UIBarItem.cs Cleans up XML docs (removes placeholder docs; improves param docs).
src/ModelIO/MDLStructs.cs Cleans up XML docs (removes placeholder remarks; improves param docs).
src/Foundation/NSSecureCoding.cs Cleans up XML docs (removes placeholder remarks/returns; improves param docs).
src/CoreImage/CIFilter.cs Cleans up XML docs (removes placeholder docs; improves param docs).
src/CoreGraphics/CGVector.cs Cleans up XML docs (removes placeholder docs; improves summaries/params/returns).
src/Contacts/CNSocialProfile.cs Cleans up XML docs (removes placeholder remarks; improves param docs).
src/Contacts/CNInstantMessageAddress.cs Cleans up XML docs and fixes punctuation in summaries/param docs.
src/AppKit/NSPrintInfo.cs Replaces placeholder XML docs with meaningful summaries.

Comment thread tests/dotnet/LinkerAttributesTestApp/AppDelegate.cs
@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

❌ [CI Build #a8f6e4e] Prepare .NET Release failed ❌

The following jobs reported a non-successful result:

Job Result
Sign NuGets ✅ Succeeded
Convert NuGet to MSI ✅ Succeeded
Push NuGets ❌ Failed
📦 Signed NuGet packages (32 packages)

iOS

  • Microsoft.iOS.Ref.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.iOS.Runtime.ios-arm64.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.iOS.Runtime.ios.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.iOS.Runtime.iossimulator-arm64.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.iOS.Runtime.iossimulator-x64.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.iOS.Sdk.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.iOS.Templates.26.5.11993-net11-rc.1.nupkg
  • Microsoft.iOS.Windows.Sdk.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.NET.Sdk.iOS.Manifest-11.0.100-preview.7.26.5.11993-net11-rc.1.nupkg

MacCatalyst

  • Microsoft.MacCatalyst.Ref.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst-x64.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.MacCatalyst.Runtime.maccatalyst.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.MacCatalyst.Sdk.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.MacCatalyst.Templates.26.5.11993-net11-rc.1.nupkg
  • Microsoft.NET.Sdk.MacCatalyst.Manifest-11.0.100-preview.7.26.5.11993-net11-rc.1.nupkg

macOS

  • Microsoft.macOS.Ref.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.macOS.Runtime.osx-arm64.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.macOS.Runtime.osx-x64.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.macOS.Runtime.osx.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.macOS.Sdk.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.macOS.Templates.26.5.11993-net11-rc.1.nupkg
  • Microsoft.NET.Sdk.macOS.Manifest-11.0.100-preview.7.26.5.11993-net11-rc.1.nupkg

tvOS

  • Microsoft.NET.Sdk.tvOS.Manifest-11.0.100-preview.7.26.5.11993-net11-rc.1.nupkg
  • Microsoft.tvOS.Ref.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.tvOS.Runtime.tvos-arm64.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.tvOS.Runtime.tvos.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-arm64.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.tvOS.Runtime.tvossimulator-x64.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.tvOS.Sdk.net11.0_26.5.26.5.11993-net11-rc.1.nupkg
  • Microsoft.tvOS.Templates.26.5.11993-net11-rc.1.nupkg

Other

  • Sharpie.Bind.Tool.26.6.0.597-net11-rc.1.nupkg

Pipeline on Agent
Hash: a8f6e4e12c99fa4156d81abe24e068fac54dfa62 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne
rolfbjarne enabled auto-merge July 28, 2026 16:37
@rolfbjarne rolfbjarne added the ready-to-review This PR is ready to review/merge. label Jul 28, 2026
@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: 56403902219455b024e7f5f9e653f54c21d9418e [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #5640390] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

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

Failures

❌ monotouch tests (iOS)

1 tests failed, 22 tests passed.

Failed tests

  • monotouch-test/iOS - simulator/Release (link all): Failed

Html Report (VSDrops) Download

Successes

✅ 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 (MacCatalyst): All 23 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 23 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: 56403902219455b024e7f5f9e653f54c21d9418e [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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