Skip to content

[msbuild] Deprecate NoBindingEmbedding=false in .NET 11, remove in .NET 12#25962

Open
rolfbjarne wants to merge 3 commits into
mainfrom
dev/rolf/deprecate-nobindingembedding
Open

[msbuild] Deprecate NoBindingEmbedding=false in .NET 11, remove in .NET 12#25962
rolfbjarne wants to merge 3 commits into
mainfrom
dev/rolf/deprecate-nobindingembedding

Conversation

@rolfbjarne

@rolfbjarne rolfbjarne commented Jul 7, 2026

Copy link
Copy Markdown
Member

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 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.

…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>
@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

✅ [PR Build #5c83e82] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 5c83e8249e67f3d56fb3670ac43fe06f48aefa8a [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

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

Pipeline on Agent
Hash: 5c83e8249e67f3d56fb3670ac43fe06f48aefa8a [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

✅ [PR Build #5c83e82] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 5c83e8249e67f3d56fb3670ac43fe06f48aefa8a [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne marked this pull request as ready for review July 8, 2026 11:43
@rolfbjarne rolfbjarne requested a review from mauroa as a code owner July 8, 2026 11:43
Copilot AI review requested due to automatic review settings July 8, 2026 11:43

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 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=false as 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+.

Comment thread msbuild/Xamarin.Shared/Xamarin.Shared.props
Comment thread docs/building-apps/build-properties.md Outdated
@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: 4431207567777aee968066b9c3c1a046934613be [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [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
✅ 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 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 17 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 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. 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. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 4431207567777aee968066b9c3c1a046934613be [PR build]

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants