-
Notifications
You must be signed in to change notification settings - Fork 122
Fix weak reference rehydration scenarios for non projected types #2043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sergio0694
approved these changes
Aug 27, 2025
kythant
approved these changes
Aug 27, 2025
Member
Author
|
@microsoft-github-policy-service rerun |
glennawatson
pushed a commit
to reactiveui/ReactiveUI
that referenced
this pull request
Dec 14, 2025
…release.251115.2 (#4204) This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [Microsoft.Windows.CsWinRT](https://redirect.github.com/microsoft/cswinrt) | `2.3.0-prerelease.251015.2` -> `2.3.0-prerelease.251115.2` |  |  | --- ### Release Notes <details> <summary>microsoft/cswinrt (Microsoft.Windows.CsWinRT)</summary> ### [`v2.3.0-prerelease.251115.2`](https://redirect.github.com/microsoft/CsWinRT/releases/tag/2.3.0-prerelease.251115.2): CsWinRT 2.3.0-prerelease.251115.2 This is a prerelease version of C#/WinRT with more bug fixes and improvements. **C#/WinRT package**: <https://www.nuget.org/packages/Microsoft.Windows.CsWinRT/2.3.0-prerelease.251115.2> #### What's Changed - Fix warning by [@​manodasanW](https://redirect.github.com/manodasanW) in [microsoft/CsWinRT#2023](https://redirect.github.com/microsoft/CsWinRT/pull/2023) - Use FormatMessage for exception messages in cases where the stowed/language exception doesn't contain a message by [@​ahmed605](https://redirect.github.com/ahmed605) in [microsoft/CsWinRT#2022](https://redirect.github.com/microsoft/CsWinRT/pull/2022) - Merge to staging/2.3 by [@​manodasanW](https://redirect.github.com/manodasanW) in [microsoft/CsWinRT#2025](https://redirect.github.com/microsoft/CsWinRT/pull/2025) - Merge staging/2.3 to master by [@​manodasanW](https://redirect.github.com/manodasanW) in [microsoft/CsWinRT#2030](https://redirect.github.com/microsoft/CsWinRT/pull/2030) - Fix 'Initialize' typo in several files by [@​Lightczx](https://redirect.github.com/Lightczx) in [microsoft/CsWinRT#2035](https://redirect.github.com/microsoft/CsWinRT/pull/2035) - Fix design time build error causing incremental build issue by [@​manodasanW](https://redirect.github.com/manodasanW) in [microsoft/CsWinRT#2036](https://redirect.github.com/microsoft/CsWinRT/pull/2036) - Move TestWinRT repo clone to resource by [@​manodasanW](https://redirect.github.com/manodasanW) in [microsoft/CsWinRT#2032](https://redirect.github.com/microsoft/CsWinRT/pull/2032) - Fix weak reference rehydration scenarios for non projected types by [@​manodasanW](https://redirect.github.com/manodasanW) in [microsoft/CsWinRT#2043](https://redirect.github.com/microsoft/CsWinRT/pull/2043) - Add UpToDateCheckBuilt to cover incremental build of Implementation dlls by [@​jevansaks](https://redirect.github.com/jevansaks) in [microsoft/CsWinRT#2051](https://redirect.github.com/microsoft/CsWinRT/pull/2051) - Fix issue where IReferenceArray is not being found by [@​manodasanW](https://redirect.github.com/manodasanW) in [microsoft/CsWinRT#2071](https://redirect.github.com/microsoft/CsWinRT/pull/2071) - Fix issue with unsubscribing from events on non-agile objects by [@​manodasanW](https://redirect.github.com/manodasanW) in [microsoft/CsWinRT#2079](https://redirect.github.com/microsoft/CsWinRT/pull/2079) - Fix issues with CopyToManagedArray by [@​manodasanW](https://redirect.github.com/manodasanW) in [microsoft/CsWinRT#2084](https://redirect.github.com/microsoft/CsWinRT/pull/2084) #### New Contributors - [@​ahmed605](https://redirect.github.com/ahmed605) made their first contribution in [microsoft/CsWinRT#2022](https://redirect.github.com/microsoft/CsWinRT/pull/2022) - [@​Lightczx](https://redirect.github.com/Lightczx) made their first contribution in [microsoft/CsWinRT#2035](https://redirect.github.com/microsoft/CsWinRT/pull/2035) **Full Changelog**: <microsoft/CsWinRT@2.3.0-prerelease.250720.1...2.3.0-prerelease.251115.2> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/reactiveui/ReactiveUI). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xNi4xIiwidXBkYXRlZEluVmVyIjoiNDIuMzIuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiRGVwZW5kZW5jeSBNYW5hZ2VtZW50Il19--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes scenario where .NET may rehydrate a weak reference and ask us to create an RCW object for it without us having any type information. This specifically affects non projected types.
Lets say we created an RCW for a non-projected type based on a base class and stored it as a weak reference. If this RCW type goes away, but the native WinRT object is still alive, .NET will ask us to create the RCW object again when the weak reference is resolved. When this happens we no longer have the static type information we had before when we constructed it due to a call from our projection. So we can end up returning an IInspectable and Resolve will fail as it expects the base type from before. We address this by taking note of such scenarios and storing the runtime class name to base type mapping and keeping it up to date if we encounter more derived types. This allows us to recreate the RCW type with the previously known static type information when we encounter the same runtime class name again.