Skip to content

Conversation

@rolfbjarne
Copy link
Member

Say we have:

  1. A native type with an init method.
  2. A managed binding for that native type, but the init method isn't bound.
  3. A managed subclass of the managed binding (also without an implementation for the init method).

In this case, native code can create a native instance of the subclass, but no
managed code is executed, which means there won't be a corresponding managed
peer either.

This became a problem in our ConformsToProtocol override/implementation,
because recently it changed to just return 'false' if we couldn't find a
managed peer for a native instance.

The fix is to create the managed instance in that case (by doing what we did
before: call "Runtime.GetNSObject" on the native handle).

Fixes #24111.

…ave a managed peer yet. Fixes #24111.

Say we have:

1. A native type with an init method.
2. A managed binding for that native type, but the init method isn't bound.
3. A managed subclass of the managed binding (also without an implementation for the init method).

In this case, native code can create a native instance of the subclass, but no
managed code is executed, which means there won't be a corresponding managed
peer either.

This became a problem in our ConformsToProtocol override/implementation,
because recently it changed to just return 'false' if we couldn't find a
managed peer for a native instance.

The fix is to create the managed instance in that case (by doing what we did
before: call "Runtime.GetNSObject" on the native handle).

Fixes #24111.
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #c9105ae] Build passed (Build packages) ✅

Pipeline on Agent
Hash: c9105ae85b0a5843377d9fde0c3e6be9af34444f [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

Pipeline on Agent
Hash: c9105ae85b0a5843377d9fde0c3e6be9af34444f [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
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: c9105ae85b0a5843377d9fde0c3e6be9af34444f [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #c9105ae] Build passed (Build macOS tests) ✅

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

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #c9105ae] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: c9105ae85b0a5843377d9fde0c3e6be9af34444f [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #c9105ae] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: c9105ae85b0a5843377d9fde0c3e6be9af34444f [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #c9105ae] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: c9105ae85b0a5843377d9fde0c3e6be9af34444f [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #c9105ae] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: c9105ae85b0a5843377d9fde0c3e6be9af34444f [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #c9105ae] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: c9105ae85b0a5843377d9fde0c3e6be9af34444f [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #c9105ae] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 115 tests passed 🎉

Tests counts

✅ 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: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 8 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 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

Pipeline on Agent
Hash: c9105ae85b0a5843377d9fde0c3e6be9af34444f [PR build]

@dalexsoto
Copy link
Member

Let's backport it to our 10 release branch 👍

@vs-mobiletools-engineering-service2

This comment has been minimized.

@dalexsoto dalexsoto merged commit 3ad2fdd into main Nov 6, 2025
41 checks passed
rolfbjarne added a commit that referenced this pull request Nov 6, 2025
…tances that don't have a managed peer yet. Fixes #24111. (#24190)

Say we have:

1. A native type with an init method.
2. A managed binding for that native type, but the init method isn't bound.
3. A managed subclass of the managed binding (also without an implementation for the init method).

In this case, native code can create a native instance of the subclass, but no
managed code is executed, which means there won't be a corresponding managed
peer either.

This became a problem in our ConformsToProtocol override/implementation,
because recently it changed to just return 'false' if we couldn't find a
managed peer for a native instance.

The fix is to create the managed instance in that case (by doing what we
did before: call "Runtime.GetNSObject" on the native handle).

Fixes #24111.

---------

Backport of #24189.
rolfbjarne added a commit that referenced this pull request Nov 6, 2025
…ances that don't have a managed peer yet. Fixes #24111. (#24191)

Say we have:

1. A native type with an init method.
2. A managed binding for that native type, but the init method isn't bound.
3. A managed subclass of the managed binding (also without an implementation for the init method).

In this case, native code can create a native instance of the subclass, but no
managed code is executed, which means there won't be a corresponding managed
peer either.

This became a problem in our ConformsToProtocol override/implementation,
because recently it changed to just return 'false' if we couldn't find a
managed peer for a native instance.

The fix is to create the managed instance in that case (by doing what we did
before: call "Runtime.GetNSObject" on the native handle).

Fixes #24111.

---------

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS Notification Service Extension fails to launch (worked in 9.0.305)

4 participants