[msbuild] Deprecate NoBindingEmbedding=false in .NET 11, remove in .NET 12#25962
[msbuild] Deprecate NoBindingEmbedding=false in .NET 11, remove in .NET 12#25962rolfbjarne wants to merge 3 commits into
Conversation
…ET 12 Setting `NoBindingEmbedding=false` (embedding native libraries in the managed assembly) should no longer be necessary (and doesn't even work with .xcframeworks, only .frameworks, .a and .dylib files). However, supporting it duplicates the testing matrix for binding projects, and it's also a source of bugs, so start the process of removing support for it. Setting `NoBindingEmbedding=false` will now be deprecated in .NET 11 with a build warning, and produces a build error in .NET 12+. And then at some point after .NET 12+ we can remove any supporting code/tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #5c83e82] Build passed (Build packages) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #5c83e82] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #5c83e82] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR starts the deprecation/removal process for NoBindingEmbedding=false in ObjC binding projects, to reduce duplicated build/test matrix coverage and eliminate a problematic legacy mode (especially with .xcframework support).
Changes:
- Add MSBuild properties to flag
NoBindingEmbedding=falseas deprecated/removed based on target .NET version. - Emit a build warning for deprecated usage and a build error for removed usage during binding native reference preparation.
- Document the deprecation/removal timeline in the build properties documentation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| msbuild/Xamarin.Shared/Xamarin.Shared.props | Introduces _NoBindingEmbeddingDeprecated / _NoBindingEmbeddingRemoved version-gated properties for binding projects. |
| msbuild/Xamarin.Shared/Xamarin.Shared.ObjCBinding.targets | Emits a warning/error when NoBindingEmbedding is set to a non-true value, before preparing native references. |
| docs/building-apps/build-properties.md | Adds a warning callout documenting deprecation in .NET 11 and error in .NET 12+. |
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #4431207] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 199 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Setting
NoBindingEmbedding=false(embedding native libraries in the managed assembly) should no longer be necessary (and doesn't even work with.xcframeworks, only.frameworks,.aand.dylibfiles).However, supporting it duplicates the testing matrix for binding projects, and it's also a source of bugs, so start the process of removing support for it.
Setting
NoBindingEmbedding=falsewill now be deprecated in .NET 10+ with a build warning, and produces a build error in .NET 12+. And then at some point after .NET 12+ we can remove any supporting code/tests.